This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author petri.lehtinen
Recipients gnezdo, petri.lehtinen
Date 2011-05-30.09:02:32
SpamBayes Score 6.2215716e-10
Marked as misclassified No
Message-id <1306746153.39.0.536295915448.issue12198@psf.upfronthosting.co.za>
In-reply-to
Content
On 2.7, your example raises an error:

Traceback (most recent call last):
  File "a.py", line 7, in <module>
    z.write("a", "a")
  File "/home/petri/tmp/cpython/cpython/Lib/zipfile.py", line 1071, in write
    self.fp.write(zinfo.FileHeader())
  File "/home/petri/tmp/cpython/cpython/Lib/zipfile.py", line 348, in FileHeader
    len(filename), len(extra))
struct.error: ushort format requires 0 <= number <= USHRT_MAX

I doubt this can be fixed in 2.6 anymore, as it's in security fix only -mode.

What comes to the error on 2.7, it could be better. If zip files simply don't support dates before 1980, an error describing this could be raised. Another possibility would be to clamp too old dates to 1980.
History
Date User Action Args
2011-05-30 09:02:33petri.lehtinensetrecipients: + petri.lehtinen, gnezdo
2011-05-30 09:02:33petri.lehtinensetmessageid: <1306746153.39.0.536295915448.issue12198@psf.upfronthosting.co.za>
2011-05-30 09:02:32petri.lehtinenlinkissue12198 messages
2011-05-30 09:02:32petri.lehtinencreate