PUT_factory: __name__ ignored (Problem with non-ascii chars)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Why it's needed:
It's a big issue with filenames that contain non-ascii characters, like German umlauts. When trying to upload them, it raises an error: BadRequest: The id "Täst.png" contains characters illegal in URLs.
Problem description:
When uploading a file via FTP and using a PUT_factory, the __name__ I provide is ignored.
code in the factory, i.e.: ob= Image(name, '', body, content_type=typ)
I tried using a custom class and I'm setting the __name__ and id of the newly created object in the __init__ method of its class. However this is completely ignored. For debugging purposes, I raised an exception in the last line of my __init__:
raise Exception, self.id
This gives me the correct newly created id. But it raises the error nonetheless, so I guess it is overwritten when the file is uploaded to the object. manage_afterAdd is not called.
Zope 2 only supports ascii object ids and urls at this point. So uploading files with non-ascii characters will definitely fail.
This isn't the place to debug and give support for custom code that tries to work around this. I believe there's a user mailing list somewhere.