[issue16310] zipfile: allow surrogates in filenames

Stefan Holek report at bugs.python.org
Thu Oct 25 13:56:45 CEST 2012


Stefan Holek added the comment:

What we are trying to do is make distribute work with non-ASCII filenames, and this is one of the things we ran into.

Fact 1: Filenames are bytes, whether you like it or not. Treating them as strings is going to give you more trouble than dragging the bytes along.

Fact 2: Surrogates are Python 3's way of dealing with bytes.

Fact 3: What follows is that surrogates must be supported wherever Python 3 deals with filenames.

Fact 4: This is a *bug* since Python breaks its own rules here (I have removed the enhancement marker). The issue is not what ZIP can do, but what Python 3 *must* do. Creating a potentially non-standard ZIP file is fine, exploding in the user's face is not.

----------
type: enhancement -> 
versions: +Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16310>
_______________________________________


More information about the Python-bugs-list mailing list