R. David Murray <rdmur...@bitdance.com> added the comment:

Well, this is the same 
treat-strings-and-byte-strings-equivalently-in-the-same-API problem that we've 
had elsewhere.  It'll require a bit of refactoring to make it work.

On read zipfile decodes filenames using cp437 if the utf-8 flag isn't set.  
Logically, then, a binary string should be encoded using cp437.  Since cp437 
has a character corresponding to each of the 256 bytes, it seems to me it 
should be enough to decode a binary filename using cp437 and set a flag that 
_encodeFilenameFlags would respect and re-encode to cp437 instead of utf-8.  
That might produce unexpected results if someone passes in a binary filename 
encoded in some other character set, but it would be consistent with how 
zipfiles work and so should be at least as interoperable as zipfiles normally 
are.

----------
title: zipfile.write, arcname should be bytestring -> zipfile.write, arcname 
should be allowed to be a byte string

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

Reply via email to