Issue1698917
Created on 2007-04-12 03:27 by alanmcintyre, last changed 2008-01-15 00:03 by rhettinger.
| msg52417 (view) |
Author: Alan McIntyre (alanmcintyre) |
Date: 2007-04-12 03:27 |
|
This patch for 2.5 is in reference to bug [ 1698398 ] - "wrong % of params
for format string in ZipFile.printdir()." It makes the following changes:
- Modify ZipFile.printdir() to treat the ZipInfo.date_time object in a way
that is similar to other code in zipfile.py.
- Modified ZipFile.writestr() to pass a 6-item tuple to the ZipInfo
constructor (consistent with other treatment of ZipInfo construction in the
zipfile module) instead of the full result from time.localtime().
Passes full regrtest.py -r
|
| msg52418 (view) |
Author: Neal Norwitz (nnorwitz) |
Date: 2007-04-19 06:22 |
|
Alan, thanks for the patch. Would you create a test case for this?
|
| msg52419 (view) |
Author: Alan McIntyre (alanmcintyre) |
Date: 2007-04-19 14:52 |
|
I would be glad to; is there a preferred way to test the output of a print statement? If I have time today I can go dig around in the stdlib to look for examples of it, but any pointers would be welcome.
|
| msg52420 (view) |
Author: Alan McIntyre (alanmcintyre) |
Date: 2007-04-19 15:59 |
|
I see that there's already a test that checks printdir (it just doesn't check the modified time). I'll work up a modified version of that to check the situation that caused the original bug.
|
| msg52421 (view) |
Author: Alan McIntyre (alanmcintyre) |
Date: 2007-04-19 16:34 |
|
I added a test for printdir. I also updated some comments to reflect that the modified date is now tested, and changed the imports at the top of the test module to conform to PEP8.
File Added: zipfile-printdir-2.diff
|
| msg59933 (view) |
Author: Raymond Hettinger (rhettinger) |
Date: 2008-01-14 23:05 |
|
Fixed in revision 59959
|
| msg59935 (view) |
Author: Alan McIntyre (alanmcintyre) |
Date: 2008-01-14 23:08 |
|
I think you applied the wrong patch; the referenced revision doesn't
include the tests from zipfile-printdir-2.diff.
|
| msg59941 (view) |
Author: Raymond Hettinger (rhettinger) |
Date: 2008-01-15 00:03 |
|
It was the right solution (a simplified version of the original patch).
Will also add more tests when I get a chance.
BTW, thanks for reporting this bug.
|
|
| Date |
User |
Action |
Args |
| 2008-01-15 00:03:56 | rhettinger | set | messages:
+ msg59941 |
| 2008-01-14 23:08:04 | alanmcintyre | set | messages:
+ msg59935 |
| 2008-01-14 23:05:30 | rhettinger | set | status: open -> closed nosy:
+ rhettinger resolution: accepted messages:
+ msg59933 |
| 2007-04-12 03:27:18 | alanmcintyre | create | |
|