checkValidId breaks on unicode ids
Bug #672846 reported by
Elizabeth Leddy
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Invalid
|
Wishlist
|
Unassigned |
Bug Description
In OFS, ObjectManager.py, if you send in a unicode id it raises bad a bad request, although it seems like one should still be able to send it in. The code looks like its missing an else statement:
def checkValidId(self, id, allow_dup=0):
...
if not id or not isinstance(id, str):
if isinstance(id, unicode):
id = escape(id)
raise BadRequest, ('Empty or invalid id specified', id)
...
Based on this it looks like the bad request error should only be thrown if the id is not unicode. Hard to say for sure though.
Running Zope 2.12 but it looks like its in the latest release as well.
To post a comment you must log in.
Zope2 only supports ids in ascii, so the validator is correct. Adding support for Unicode ids is a long requested feature, which nobody had time to implement yet.