[issue45981] Get raw file name in bytes from ZipFile
Eric V. Smith
report at bugs.python.org
Sat Dec 4 09:16:18 EST 2021
Eric V. Smith <eric at trueblade.com> added the comment:
You would also need to decide what to do with these lines, just before the os.sep test:
# Terminate the file name at the first null byte. Null bytes in file
# names are used as tricks by viruses in archives.
null_byte = filename.find(chr(0))
if null_byte >= 0:
filename = filename[0:null_byte]
I don't think you'd want to do this on an encoded (raw) filename, but on the other hand the comment makes a good point.
----------
nosy: +eric.smith
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45981>
_______________________________________
More information about the Python-bugs-list
mailing list