PUT_factory: __name__ ignored (Problem with non-ascii chars)

Bug #1073875 reported by Georg Pfolz
6
This bug affects 1 person
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.

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

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.

Changed in zope2:
status: New → Confirmed
Revision history for this message
Georg Pfolz (georg-pfolz) wrote :

ok, so it's not a bug. But as there does not seem to be a way around, it would be nice to have this "fixed" nonetheless. The non-US world is full of filenames with non-ascii characters.

Revision history for this message
Georg Pfolz (georg-pfolz) wrote :

Uploading a file with non-ascii characters should not automatically fail. At least there should be a possibility for the developer to provide a legal Zope id for such a file.

I didn't ask for support. As I understand it, there is no work around for this issue (sadly).

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.