R. David Murray added the comment:

The problem you are reporting looks different than the problem addressed in 
issue 8390.  There, the surrogates are being introduced when reading filenames 
from the archive file.  Here, the surrogates presumably arose because the 
filename on your file system was not utf-8 encoded and so Python introduced the 
surrogates to preserve the filename.  The bug is that zipfile is not handling 
surrogates when *building* the archive...which may in fact be correct.  If I 
understand correctly there are two encodings supported by zipfile, a Microsoft 
code page and utf-8.  Anything else should probably be rejected as invalid, but 
with a better error message.  If you really need to include invalid filenames 
in an archive, we would introduce an explict flag for allowing that.

But, that's just my opinion.  ("Be generous in what you accept, and strict in 
what you send")

----------
nosy: +r.david.murray

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16310>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to