(un)restrictedTraverse fails with unicode Strings as Path
Bug #142117 reported by
Christian Theune
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Invalid
|
Medium
|
Unassigned |
Bug Description
Zopes unrestrictedTra
Possible solution: (i don't like it, but it's easily implemented, and i am no unicode expert) cast the path string to a default python string
To post a comment you must log in.
Ok, I did a bit more research on that and found the splitting beeing the problem. Line 78 of Traversable.py tells us, that type(u"asdf") is not a StringType and so it is only converted into a list so that the NamespaceStack looks like [u"asdf"].
Another hint: string. split(u" asdf") won't work too. But u"asdf".split() works fine.
At the moment i can't create a patch, as I don't know how to make a good use of checking for subclasses of string, because strings and unicode strings don't have a __class__ attribute.