Dapbler / cbr2cbz

Python script that converts compressed CBR and CBZ comic archives to stored CBZ. Many options.
GNU General Public License v3.0
26 stars 5 forks source link

Fix ValueError when file has timestamp older than 1980 #30

Closed mikeymakesit closed 1 year ago

mikeymakesit commented 1 year ago

I tracked down an issue where occasionally the try/except on line 462 would fail with exception "ValueError".

Adding some exception logging resulted in this message:

ValueError: ZIP does not support timestamps before 1980

I found in the zipfile module you can provide option strict_timestamps=False to disable the file date strictness. When disabling this feature, the file date will get changed to the minimum supported by the module, and not produce an exception.

That's what I've added and suggest you consider merging this change to prevent others suffering this issue.

Dapbler commented 1 year ago

Thanks,great find. Merging it in (after a... modest delay...)