On Sat, 14 Jun 2014 13:20:01 -0500
"'Terry Brown' via leo-editor" <[email protected]> wrote:

> On Sat, 14 Jun 2014 10:19:44 -0700 (PDT)
> "Edward K. Ream" <[email protected]> wrote:
> 
> > I made a number of changes, but not enough, it seems.  todo works
> > with PyQt4 but not 5.  For example, icons don't appear in headlines.
> 
> I'll take a look when I can.
> 
> todo.py doesn't work with Python 3, well, it does, but it can't read
> datetime objects pickled in 2.x, which is annoying.  I have not been
> able to find any 3.x code that will read a 2.7 datetime pickle,
> although maybe I haven't tried in 3.4, I think there were some changes
> in pickle recently.
> 
> Current plan is to have todo.py convert dates to string
> representations in 2.x, and report files that need running through 2.x
> when they're encountered in 3.x

Woohoo - finally found a way around this, there's a special encoding
`bytes` that can be used, at least in 3.4, not sure about earlier 3.x
series.

-            g.trace('can not unpickle %s=%s' % (attr,val))
-            return val
+            try:
+                # for python 2.7 in python 3.4
+                val2 = pickle.loads(binString, encoding='bytes')
+                return val2
+            except 
(pickle.UnpicklingError,ImportError,AttributeError,ValueError,TypeError):
+                g.trace('can not unpickle %s=%s' % (attr,val))
+                return val

Cheers -Terry

> Cheers -Terry
> 

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to