You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
With python >= 3.5 there is an issue with the Undo tab, server fail with:
File "/home/theo/.local/share/virtualenvs/starbox-R9wHKfrZ/lib/python3.6/site-packages/substanced/sdi/views/undo.py", line 158, in undo
batch = self._undoable_transactions(first, last)
File "/home/theo/.local/share/virtualenvs/starbox-R9wHKfrZ/lib/python3.6/site-packages/substanced/sdi/views/undo.py", line 141, in _undoable_transactions
tid = encode64(tid) + b' ' + desc
TypeError: can't concat str to bytes
There is no str to bytes implicit conversion. Here a diff to make it work in python 2.7 and 3.5 :
diff --git a/substanced/sdi/views/undo.py b/substanced/sdi/views/undo.py
index 5d241d01..5f9fab08 100644
--- a/substanced/sdi/views/undo.py
+++ b/substanced/sdi/views/undo.py
@@ -128,7 +128,7 @@ class UndoViews(object):
t = datetime.datetime.fromtimestamp(d['time'])
t = tz.localize(t).strftime('%Y-%m-%d %H:%M:%S %Z')
d['time'] = t
- desc = d['description'] or b''
+ desc = d['description'].encode('ascii') or b''
if not isinstance(desc, bytes): #pragma NO COVER Py3k
desc = desc.encode('ascii', 'surrogateescape')
tid = d['id']
The text was updated successfully, but these errors were encountered:
Hi, thanks for the ticket. Judging from the traceback, you are running the pypi released version, right? This problem has been corrected on master. I just confirmed it works on Python 3.5.2.
Hi,
With python >= 3.5 there is an issue with the Undo tab, server fail with:
There is no str to bytes implicit conversion. Here a diff to make it work in python 2.7 and 3.5 :
The text was updated successfully, but these errors were encountered: