8000 Fix mtime header parsing by sirosen · Pull Request #567 · python-jsonschema/check-jsonschema · GitHub
[go: up one dir, main page]

Skip to content

Fix mtime header parsing #567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 18, 2025
Merged

Fix mtime header parsing #567

merged 3 commits into from
May 18, 2025

Conversation

sirosen
Copy link
Member
@sirosen sirosen commented May 18, 2025

I wasn't able to push a rebase+fix to #565, so this is a follow-up. Resolves #565.


  • Use calendar.timegm instead of time.mktime for UTC timestamps
  • Add a regression test for localtime handling

Radosław Kozicki and others added 3 commits May 17, 2025 15:20
time.mktime() converts a time tuple in local time to seconds since the
Epoch, as stated in the docs:

> Convert a time tuple in local time to seconds since the Epoch.
> Note that mktime(gmtime(0)) will not generally return zero for most
> time zones; instead the returned value will either be equal to that
> of the timezone or altzone attributes on the time module.

calendar.timegm() is guaranteed to produce UTC timestamp:

> Unrelated but handy function to calculate Unix timestamp from GMT.
@sirosen sirosen merged commit f98acd4 into main May 18, 2025
45 checks passed
@sirosen sirosen deleted the cache_mtime branch May 18, 2025 04:24
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.

1 participant
0