(un)restrictedTraverse fails with unicode Strings as Path

Bug #142117 reported by Christian Theune on 2002-07-08
Affects Status Importance Assigned to Milestone
Zope 2

Bug Description

Zopes unrestrictedTraverse function from OFS.Traversable splits the given path, failing when it receives a unicode string.

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

Christian Theune (ctheune) wrote :

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.

Christian Theune (ctheune) wrote :

Just a little reminder. Could somebody please reject or accept this? Thanks.

Andreas Jung (ajung) wrote :

Status: Pending => Rejected

If a string is expected than a string and not a unicode string
should be passed.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers