checkValidId breaks on unicode ids

Bug #672846 reported by Elizabeth Leddy
6
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.

Revision history for this message
Hanno Schlichting (hannosch) wrote :

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.

Changed in zope2:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Andreas Jung (ajung) wrote :

Isn't there a huge Dieter patch floating around somewhere in the tracker?

Revision history for this message
Hanno Schlichting (hannosch) wrote :

There's https://bugs.launchpad.net/zope2/+bug/374724 which has some code and a really minor number of tests. With a change like this, there's lots of places where things will go wrong. So the provided patch is not more than a basic starting ground. The patch is even marked as "tests failing".

Revision history for this message
Colin Watson (cjwatson) wrote :

The zope2 project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope2.

Changed in zope2:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.