Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 7 Mar 2013 19:54:18 +0100
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: Odf2John

On 7 Mar, 2013, at 19:43 , Rich Rumble <richrumble@...il.com> wrote:

> On Thu, Mar 7, 2013 at 1:37 PM, magnum <john.magnum@...hmail.com> wrote:
> On 7 Mar, 2013, at 19:33 , magnum <john.magnum@...hmail.com> wrote:
> 
> > On 7 Mar, 2013, at 1:12 , Rich Rumble <richrumble@...il.com> wrote:
> >> I did a quick search and it looks like "getiterator" works instead of iter() for 2.6
> >>
> >> Line 32
> >> +    elements = list(r.getiterator())
> >> -    elements = list(r.iter())
> >>
> >> Again I'm no programmer/scripter but that change allows it to work for me.
> >
> > I don't know python well but with your change, 2.7 still works fine. So I committed this. Thanks!
> 
> We might need to revise it in the future though:
> http://stackoverflow.com/questions/3077010/what-is-the-difference-between-getiterator-and-iter-wrt-to-lxml
> 
> That does seem to be the case, I don't program anything other than my Tivo, so I am just glad I got it to work myself! It may just be something for someone else to look at, or possibly a commented out line in the code if someone did want to change it simply and toggle the lines. I think going into version checking for this would be over kill. Maybe some "more universal" fix is available?
> -rich

After some googling I think I'll add another commit:

-    elements = list(r.getiterator())
+    # getiterator() is deprecated but 2.6 does not have iter()
+    try :
+        elements = list(r.iter())
+    except :
+        elements = list(r.getiterator())

...it should work even with future code.

magnum

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ