Skip to content

Conversation

@VanshAgarwal24036
Copy link
Contributor

ZIP (DOS) timestamps do not include timezone information, but CPython currently
interprets them as local time via time.mktime(). This can cause .pyc files to be
incorrectly marked as stale when a zipapp is created and run in different
timezones.

This change uses calendar.timegm() so ZIP source timestamps are interpreted with
UTC semantics, matching .pyc timestamp handling.

Fixes gh-141431

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.pyc file in zipapp can be marked as stale if opened in a different timezone than the one it was created in

1 participant