Issue 3317: duplicate lines in zipfile.py (original) (raw)

Created on 2008-07-07 20:57 by amaury.forgeotdarc, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
zipfile-removedups.patch amaury.forgeotdarc,2008-07-08 07:17
Messages (9)
msg69398 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-07-07 20:57
Since r64688, zipfile.py contains duplicated definitions. The attached patch removes them. Also, Twisted uses a zipfile item that have been renamed by this change: zipfile.stringFileHeader (now magicFileHeader). This makes some tests fail on the community buildbots. See the rightmost column on http://www.python.org/dev/buildbot/community/trunk/ I suggest to rename all magicXXX variables back to stringXXX.
msg69400 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-07-07 21:13
Alan, what do you think?
msg69409 - (view) Author: Alan McIntyre (alanmcintyre) * (Python committer) Date: 2008-07-08 02:37
I don't see a patch attached, but the duplicated code does need removing. If you can attach a patch I'll try it out. As much as I dislike the "string" names (magicXXX seemed much more descriptive), I suppose they're publicly available and shouldn't be renamed without a good reason. (Unless not being in __all__ counts as being something one shouldn't depend on as part of the API ;)
msg69415 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-07-08 07:17
Sorry, here is the patch
msg69416 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-07-08 07:23
Since the use of "from X import *" is discouraged (and serious projects try to avoid it), the __all__ list is less and less meaningful.
msg69419 - (view) Author: Alan McIntyre (alanmcintyre) * (Python committer) Date: 2008-07-08 08:46
The patch seems to work just fine for me, all tests pass (including test_zipfile64) on an Intel Mac. I'd vote to go ahead and revert the magicXXX variables back to their original names--I'm sure Twisted isn't the only project out there that made use of them. If the magicXXX name change gets checked in along with the current patch I'll run the zip64 tests on Mac and Linux afterward, since they don't get run in the standard test run on the buildbots. I don't currently have a Windows machine to test with.
msg69538 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-07-11 07:26
Amaury, as Alan is fine with these changes, feel free to apply them.
msg69563 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-07-11 21:28
Committed as 64880.
msg69600 - (view) Author: Alan McIntyre (alanmcintyre) * (Python committer) Date: 2008-07-12 21:03
Thanks for fixing this, Amaury. I ran the test_zipfile64 and test_zipfile tests on Linux and OS X, and they pass.
History
Date User Action Args
2022-04-11 14:56:36 admin set github: 47567
2008-07-12 21:03:54 alanmcintyre set messages: +
2008-07-11 21:28:38 amaury.forgeotdarc set status: open -> closedmessages: +
2008-07-11 07:26:01 loewis set assignee: loewis -> amaury.forgeotdarcresolution: acceptedmessages: +
2008-07-08 08:46:36 alanmcintyre set messages: +
2008-07-08 07:23:38 amaury.forgeotdarc set messages: +
2008-07-08 07🔞00 amaury.forgeotdarc set files: + zipfile-removedups.patchkeywords: + patchmessages: +
2008-07-08 02:37:48 alanmcintyre set messages: +
2008-07-07 21:13:44 loewis set nosy: + alanmcintyremessages: +
2008-07-07 20:57:49 amaury.forgeotdarc create