[issue27344] zipfile *does* support utf-8 filenames

2019-02-06 Thread Cheryl Sabella
Cheryl Sabella added the comment: This wording was removed as part of issue 32035. -- nosy: +cheryl.sabella resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may

[issue27344] zipfile *does* support utf-8 filenames

2016-06-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This note looks outdated. In 2.x 8-bit file names are written as is, implying cp437 or what your consumers expect. Unicode file names are encoded to ascii or utf-8 (with setting utf-8 flag). In 3.x only Unicode file names are accepted, and they always are

[issue27344] zipfile *does* support utf-8 filenames

2016-06-24 Thread Daniel Holth
Daniel Holth added the comment: https://hg.python.org/cpython/file/2.6/Lib/zipfile.py#l331 Python 2.6 zipfile supports utf8 properly. It has only improved since then. -- ___ Python tracker

[issue27344] zipfile *does* support utf-8 filenames

2016-06-24 Thread R. David Murray
R. David Murray added the comment: I bet the existing wording is just left over from the python2 docs. I think cp437 should still be mentioned explicitly. And mentioning "setting the utf-8 flag" would probably make the explanation clearer, though I'm not sure. Tecnically speaking, I think

[issue27344] zipfile *does* support utf-8 filenames

2016-06-23 Thread Daniel Holth
Daniel Holth added the comment: The documentation should read The ZIP file format supports Unicode filenames. If you have unicode filenames, zipfile will encode them to and from utf-8 internally, but if you pass bytes filenames to write() then they will be stored without a specified encoding.

[issue27344] zipfile *does* support utf-8 filenames

2016-06-23 Thread Daniel Holth
Daniel Holth added the comment: " ... zipfile will encode them to and from utf-8 internally, and the encoding is marked in a standard flag inside the archive member." -- ___ Python tracker

[issue27344] zipfile *does* support utf-8 filenames

2016-06-23 Thread Daniel Holth
Daniel Holth added the comment: The current documentation says "Note There is no official file name encoding for ZIP files. If you have unicode file names, you must convert them to byte strings in your desired encoding before passing them to write(). WinZip interprets all file names as

[issue27344] zipfile *does* support utf-8 filenames

2016-06-23 Thread R. David Murray
R. David Murray added the comment: OK, what do you propose as a documentation change? The current doc is accurate, but incomplete. New phrasing could include something about the two de-facto standards but that one can not be sure that filenames will be in one of those two encodings. Issue

[issue27344] zipfile *does* support utf-8 filenames

2016-06-21 Thread Daniel Holth
Daniel Holth added the comment: This is a simple documentation bug about the ZIP file format supporting utf-8 and 'no encoding' filenames depending on whether two bits are set in a flag inside the archive member. Bug 10614 appears to be a different issue about out-of-band encoding information

[issue27344] zipfile *does* support utf-8 filenames

2016-06-21 Thread R. David Murray
R. David Murray added the comment: See issue 10614 for the current state of play. This issue should probably be closed in favor of that one. -- nosy: +r.david.murray ___ Python tracker

[issue27344] zipfile *does* support utf-8 filenames

2016-06-17 Thread Terry J. Reedy
Terry J. Reedy added the comment: There is a difference between 'official' and 'supported', and I don't quite know what you mean by the latter. -- nosy: +terry.reedy ___ Python tracker

[issue27344] zipfile *does* support utf-8 filenames

2016-06-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka stage: -> needs patch versions: +Python 3.5 ___ Python tracker ___

[issue27344] zipfile *does* support utf-8 filenames

2016-06-17 Thread Daniel Holth
New submission from Daniel Holth: The zipfile documentation says "There is no official file name encoding for ZIP files." However ZIP and zipfile supports utf-8 filenames; this has been true for a long time, at least since Python 2.7. -- assignee: docs@python components: Documentation