[issue43326] About Zipfile
New submission from Fcant : When I Unzip a package using the zipfile module, the package’s filename has a newline character, which causes the Unzip to fail, so the UNZIP filename needs to be processed -- components: Library (Lib) files: Fcant_2021-02-26_11-26-37.jpg messages: 387705 nosy: Fcscanf priority: normal severity: normal status: open title: About Zipfile type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file49836/Fcant_2021-02-26_11-26-37.jpg ___ Python tracker <https://bugs.python.org/issue43326> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43326] About Zipfile
Fcant added the comment: Because these special symbols are not handled under the Window, he will report an error and will not work properly From:樊乘乘 Email:fcsc...@outlook.com<mailto:fcsc...@outlook.com> Tel:17826260016 发件人: Ronald Oussoren<mailto:rep...@bugs.python.org> 发送时间: 2021年2月26日 樊乘 17:15 收件人: fcsc...@outlook.com<mailto:fcsc...@outlook.com> 主题: [issue43326] About Zipfile Ronald Oussoren added the comment: I'm not sure what you are asking here. Looking at the screenshot I'd say that the zipfile you are trying to extract contains files with a newline in their name. That's a perfectly valid (although annoying) name on unix-y platforms. The zipfile module does not have an API for rewriting the file name when extracting. It is far from clear to me that adding such a API would be generally useful. Emulating this is fairly easy though, something like: zf = zipfile.ZipFile(...) for name in zf.namelist(): stream = zf.open(name) data = stream.read() stream.close() with open(name.replace(...), "w") as stream: stream.write(data) -- nosy: +ronaldoussoren ___ Python tracker <https://bugs.python.org/issue43326> ___ -- ___ Python tracker <https://bugs.python.org/issue43326> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43326] About Zipfile
Change by Fcant : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue43326> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com