Commit b040a520 authored by Jérome Perrin's avatar Jérome Perrin

forge: PY3 support

parent 2ecbf8e9
......@@ -64,6 +64,7 @@ class Git(WorkingCopy):
def _git(self, *args, **kw):
kw.setdefault('cwd', self.working_copy)
kw.setdefault('universal_newlines', True)
argv = ['git']
try:
return subprocess.Popen(argv + list(args), **kw)
......
......@@ -139,14 +139,14 @@ class WorkingCopy(six.with_metaclass(WorkingCopyMetaClass, Implicit)):
def _getCookie(self, name, default=None):
try:
return json.loads(b64decode(self.REQUEST[name]))
except StandardError:
return json.loads(b64decode(self.REQUEST[name]).decode())
except Exception:
return default
def _setCookie(self, name, value, days=30):
portal = self.getPortalObject()
request = portal.REQUEST
value = b64encode(json.dumps(value))
value = b64encode(json.dumps(value).encode()).decode()
request.set(name, value)
if days:
expires = (DateTime() + days).toZone('GMT').rfc822()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment