Issue 22322: Zip files created by git archive result in a SyntaxError (due to comment?) (original) (raw)

Issue22322

Created on 2014-09-01 15:11 by lekensteyn, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg226230 - (view) Author: Peter Wu (lekensteyn) Date: 2014-09-01 15:11
Files created by `git archive` are not understood by the Python interpreter. This could be caused by the additional comment (for the commit hash) in the file. echo 'print(1)' > __main__.py git init && git add __main__.py && git commit -m init git archive --format=zip HEAD > y.zip python y.zip Packing it with `zip x.zip __main__.py && python x.zip` works.
msg226233 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-09-01 16:26
You are correct. zipimport does not support zip files with comments. There is already an open issue (issue 5950) for adding support for this.
History
Date User Action Args
2022-04-11 14:58:07 admin set github: 66518
2014-09-01 16:26:14 r.david.murray set status: open -> closedsuperseder: Make zipimport work with zipfile containing commentsnosy: + r.david.murraymessages: + resolution: duplicatestage: resolved
2014-09-01 15:11:58 lekensteyn create