Launcher: build apworlds with files dated before 1980#6271
Open
patrickwehbe wants to merge 1 commit into
Open
Conversation
Building an .apworld via the launcher's "Build APWorlds" component crashed with "ValueError: ZIP does not support timestamps before 1980" when any file in the world folder had a modification time outside the ZIP format's representable range (e.g. a pre-1980 mtime from checkout/extraction). Pass strict_timestamps=False to ZipFile so such timestamps are clamped to the ZIP minimum instead of raising, allowing the build to succeed. Fixes ArchipelagoMW#5505.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this fixing or adding?
Building an
.apworldvia the launcher's "Build APWorlds" component crashes withValueError: ZIP does not support timestamps before 1980when any file in the world folder has a modification time outside the ZIP format's representable range (e.g. a pre-1980 mtime left over from checkout or extraction).Passing
strict_timestamps=FalsetoZipFile(the standard-library option for exactly this situation) clamps such timestamps to the ZIP minimum instead of raising, so the build succeeds.Fixes #5505.
How was this tested?
Reproduced the crash and confirmed the fix with a minimal repro: a file given a pre-1980 mtime via
os.utime(f, (0, 0)). With the defaultZipFileit raisesValueError: ZIP does not support timestamps before 1980; addingstrict_timestamps=Falsewrites the archive without error.