Skip to content

Conversation

LiberalArtist
Copy link
Contributor

Previously, timestamps outside the range supported by the Zip format would lead to an error from integer->integer-bytes.

The Info-ZIP zip utility and libarchive (at least as used by Ark) seem to implicitly clamp timestamps this way. Python's zipfile.ZipFile raises an error by default when timestamps are out of range, but it clamps timestamps this way when called with strict_timestamps=False.


This probably needs some tests.

Does it also need a history note?

I could imagine adding a #:strict-timestamps? option, but I think the default should be permissive: Python's strict default seems to be mostly a source of confusing errors. And at that point, it seemed better to hold off on adding a keyword until/unless someone actually wants one.

One way timestamps before 1980 happen is when translating the POSIX time 0 (1970-01-01T00:00:00Z), which is used by some tools that try to normalize extraneous metadata.

Previously, timestamps outside the range supported by the Zip format
would lead to an error from `integer->integer-bytes`.

The Info-ZIP `zip` utility and `libarchive` (at least as used by Ark)
seem to implicitly clamp timestamps this way. Python's `zipfile.ZipFile`
raises an error by default when timestamps are out of range, but it
clamps timestamps this way when called with `strict_timestamps=False`.
@mflatt
Copy link
Member

mflatt commented Oct 9, 2022

I think tests would go in pkgs/racket-test/tests/file, possibly in packers.rkt or possibly a in new file. I'd be inclined to include a history note. Clamping by default and maybe adding #:strict-timestamps? later seems fine to me.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants