Python 2.6 & elementTree

11 views
Skip to first unread message

pcurry

unread,
Jan 11, 2010, 1:50:20 PM1/11/10
to AuthKit, pcu...@wgen.net
Greetings. I am trying to help a co-worker use AuthKit in our
environment. He claims that AuthKit specifically requires elementTree
1.2.6, rather than the one included with Python 2.6.

Could you point me to where the incompatibilities might lie, or why
there are not incompatibilities, that would be really helpful. Thank
you!

-pcurry

James Gardner

unread,
Jan 13, 2010, 3:57:51 PM1/13/10
to aut...@googlegroups.com
elementTree is a dependency of the OpenID libraries I believe so if you
aren't using them it shouldn't be a problem.

James

Paul Curry

unread,
Jan 13, 2010, 7:10:15 PM1/13/10
to aut...@googlegroups.com
I'm sorry I didn't specify, we're using the 0.4.5 version of AuthKit.

Our plan was simply to alias in the elementTree implementation in Python 2.6.  We only saw the one import of elementTree, in authkit.authenticate.sso.api at line 16:

from elementTree import ElementTree

We changed that to:

from xml.etree import ElementTree

AuthKit imported fine.  The only use of the ElementTree we uncovered was in authkit.authenticate.sso.cas, at line 89:

            tree = ElementTree.fromstring(response)

which was unaffected by our change.  Though it does render AuthKit incompatible with Python 2.4.  To retain backwards compatibility, you could wrap the xml.etree call in an exception handler, and import elementTree from a third-party module if necessary.  It would certainly save trouble in Python 2.5 + environments.

Thanks for your response!

--
You received this message because you are subscribed to the Google Groups "AuthKit" group.
To post to this group, send email to aut...@googlegroups.com.
To unsubscribe from this group, send email to authkit+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/authkit?hl=en.




Reply all
Reply to author
Forward
0 new messages