New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zipfile: inconsistent filenames with InfoZip "unzip" #38653
Comments
zipfile.py gives filenames inconsistent with the Example: the attached Demo.zip (extracted from an email $ unzip -l /tmp/Demo.zip
Archive: /tmp/Demo.zip
Length Date Time Name
-------- ---- ----
DOCUME~1\CHRISS~1\LOCALS~1\Temp\Demo.exe But according to ZipFile.namelist(), the name of that DOCUME~1\CHRISS~1\LOCALS~1\Temp\Demo.exescr000000000000000000.txt Getting the same result with Python 2.2.2 and a |
Logged In: YES That almost sounds like an intentional inconsistency. Could 0000000 P K 003 004 \n \0 \0 \0 \0 \0 * Š : |
Logged In: YES The actual filename from the zipfile is: Notice there is a \x00 after Demo.exe. My guess is InfoZip You can see the zip file format description at The format does say: But it doesn't really say if strings are allowed to have So does Python or InfoZip get this right? |
Logged In: YES The analysis by sjones is correct. Python and the zip file Testing this on my machine, my virus scanner (Kaspersky) I suggest that zipfile.py should terminate file names at a null |
Logged In: YES I submitted a patch for this. It is 755987. See further |
Logged In: YES Fixed with patch bpo-755987. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: