Ronald Oussoren <[email protected]> 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 <[email protected]>
<https://bugs.python.org/issue43326>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com