GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-134261: ZipFile - Don't rely on local time for reproducible builds & tests by ctrlaltf2 · Pull Request #134264 · python/cpython

Conversation

@ctrlaltf2

@ctrlaltf2 ctrlaltf2 commented May 19, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

See #134261 for issue background and technical detail on causes. This solves the issue by using gmtime whenever SOURCE_DATE_EPOCH is involved, to prevent pulling in system timezone information when performing time calculations.

  • Issue: ZipFile tests fail in negative timezone offsets on reproducible build environments #134261

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ctrlaltf2
pythongh-134261: Don't rely on local time for reproducible builds & t…
4c389c9
…ests
@python-cla-bot

python-cla-bot Bot commented May 19, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot mentioned this pull request May 19, 2025
ZipFile tests fail in negative timezone offsets on reproducible build environments #134261
Closed
@bedevere-app

bedevere-app Bot commented May 19, 2025

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added the awaiting review label May 19, 2025
@blurb-it
📜🤖 Added by blurb_it.
e0fcc2d
@Wulian233

Wulian233 commented May 20, 2025

Copy link
Copy Markdown
Contributor

I added this feature 8 months ago. There was a reason for using localtime. See #124435 (review) and 54a7116

Maybe we can ask @jaraco

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

emmatyping
emmatyping reviewed May 27, 2025
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2025-05-19-21-08-25.gh-issue-134261.ravGYm.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@emmatyping
Merge branch 'main' into main
6fda35b
@emmatyping

emmatyping commented Jul 23, 2025

Copy link
Copy Markdown
Member

@jaraco would you have time to look at this one? Would appreciate your expertise on whether changing to UTC time would be acceptable only for cases where SOURCE_DATE_EPOCH is set.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Apr 24, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 24, 2026
jaraco
jaraco approved these changes May 19, 2026
View reviewed changes

@jaraco jaraco left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the conversation where we discussed localtime vs. gmtime.

My concern at the time was that the code was changing localtime(time.time()) to gmtime(time.time()) even for the case where SOURCE_DATE_EPOCH was unset. And at the time, there was no explanation for why that change should be made and it seemed unrelated to the proposed change.

I'm pleased to see that this PR addresses my concern by keeping the behavior unchanged for unset SOURCE_DATE_EPOCH.

Unfortunately, even the tests are merely reflecting the implementation, so aren't capturing an external expectation. We can improve that situation in this PR, at least for the SOURCE_DATE_EPOCH case.

I do think we should apply this proposed change as a bugfix to all relevant Pythons. It seems to me this value was never correct. It will mean some instability, but I'm struggling to think of any other option. Better to have consistent behavior across all patched Pythons than have reproducibility dependent on minor Python version.

It's conceivable that gmtime should also be used unconditionally, but that's a broader problem with greater backward compatibility concerns and would demand larger scrutiny.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/test/test_zipfile/test_core.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels May 19, 2026
jaraco
jaraco reviewed May 19, 2026
View reviewed changes
Comment thread Lib/test/test_zipfile/test_core.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jaraco jaraco added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels May 19, 2026
@jaraco
Materialize the expected value for the timestamp.
f7c52b8
@read-the-docs-community

read-the-docs-community Bot commented May 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #32763695 | 📁 Comparing 5c09422 against main (409fa8e)

  🔍 Preview build  

481 files changed · ± 448 modified · - 33 deleted

± Modified

  • about.html
  • bugs.html
  • glossary.html
  • index.html
  • license.html
  • py-modindex.html
  • c-api/allocation.html
  • c-api/apiabiversion.html
  • c-api/arg.html
  • c-api/buffer.html
  • and 438 more...

- Deleted

  • improve-page-nojs.html
  • improve-page.html
  • _static/tachyon-example-flamegraph.html
  • _static/tachyon-example-heatmap.html
  • c-api/curses.html
  • c-api/extension-modules.html
  • c-api/interp-lifecycle.html
  • c-api/picklebuffer.html
  • c-api/profiling.html
  • c-api/sentinel.html
  • and 23 more...
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jaraco
Correct stable timestamp.
06f66b3
jaraco
jaraco reviewed May 19, 2026
View reviewed changes
Comment thread Lib/test/test_zipfile/test_core.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

jaraco added 3 commits May 19, 2026 11:48
@jaraco
Seems a second gets lost during the zip file creation.
5c09422
@jaraco
Implement a proper timestamp comparison with tolerance.
66499d3
@jaraco
Merge branch 'main' into ctrlaltf2/main
d649130
@jaraco
jaraco enabled auto-merge (squash) May 19, 2026 19:34
@jaraco @emmatyping
Nicer blurb message.
0f962dc
Co-authored-by: Emma Smith <[email protected]>
@jaraco

jaraco commented May 20, 2026

Copy link
Copy Markdown
Member

CI runners are flaky. I've had to retry the jobs twice, both for unrelated reasons. I expect them to pass soon.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jaraco jaraco removed the stale Stale PR or inactive for long period of time. label May 20, 2026
@jaraco

jaraco commented May 20, 2026

Copy link
Copy Markdown
Member

Sadly the second retry failed in the same Ubuntu job. Sadly, it's a spurious error unrelated to this change. Here's Copilot's analysis:

This job did not fail because of a code or test regression in the PR. It was terminated by the runner infrastructure:

make ci was still running tests when the job was killed with exit code 143
the log ends with: The runner has received a shutdown signal
there is no Python traceback, assertion failure, compiler error, or failing test name before termination

Relevant evidence:

The failing step is the ASAN test job’s final test command in .github/workflows/build.yml:547-548:
    [build.yml#L547-L548](https://github.com/python/cpython/blob/0f962dc8601f31d7b9e1be6745a7cf7c4d5ef94e/.github/workflows/build.yml#L547-L548)
    run: xvfb-run make ci
The job was progressing normally through the test suite when it was interrupted.
make ci is the broad CI target from the top-level Makefile, so the interruption happened during the general test run, not in a specific failing source file.

Solution:

Treat this as a spurious CI failure and rerun the job.
No code change is justified based on these logs alone.
If this becomes repeatable in the same job, reduce susceptibility to runner interruption by narrowing the ASAN test workload rather than changing product code.

If you want a code-level mitigation for repeat occurrences, the best change is in the workflow, not CPython itself. For example, replace the broad ASAN command with a more targeted test invocation in .github/workflows/build.yml:
YAML

  • name: Tests
    run: xvfb-run ./python -m test --fast-ci --timeout 1200

or, if ASAN-specific coverage is still desired but runtime needs to be reduced, run a curated subset instead of make ci.

Bottom line: the correct solution for this job is to rerun it; there is no evidence of a bug in the referenced code from this log.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jaraco
jaraco merged commit 9dcf94e into python:main May 20, 2026
165 of 171 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented May 20, 2026

Copy link
Copy Markdown

Thanks @ctrlaltf2 for the PR, and @jaraco for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label May 20, 2026
@bedevere-app

bedevere-app Bot commented May 20, 2026

Copy link
Copy Markdown

GH-150137 is a backport of this pull request to the 3.15 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label May 20, 2026
@bedevere-app

bedevere-app Bot commented May 20, 2026

Copy link
Copy Markdown

GH-150138 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label May 20, 2026
@jaraco

jaraco commented May 20, 2026

Copy link
Copy Markdown
Member

I thought maybe there was a timeout, but that doesn't seem likely, as the second attempt ended after ~15 minutes and the third after ~9 minutes. The fourth attempt (second retry/third attempt of ubuntu freethreading) succeeded. So whatever it is is spurious.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jaraco jaraco mentioned this pull request May 20, 2026
Ubuntu freethreading build failed twice spuriously #150139
Closed
jaraco added a commit that referenced this pull request May 20, 2026
@miss-islington @ctrlaltf2
@blurb-it @emmatyping @jaraco
[3.14] gh-134261: ZipFile - Don't rely on local time for reproducible…
25092e8
… builds & tests (GH-134264) (#150138)

gh-134261: ZipFile - Don't rely on local time for reproducible builds & tests (GH-134264)

---------
(cherry picked from commit 9dcf94e)

Co-authored-by: Caleb <[email protected]>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Emma Smith <[email protected]>
Co-authored-by: Jason R. Coombs <[email protected]>
jaraco added a commit that referenced this pull request May 20, 2026
@miss-islington @ctrlaltf2
@blurb-it @emmatyping @jaraco
[3.15] gh-134261: ZipFile - Don't rely on local time for reproducible…
ca0da94
… builds & tests (GH-134264) (#150137)

gh-134261: ZipFile - Don't rely on local time for reproducible builds & tests (GH-134264)

---------
(cherry picked from commit 9dcf94e)

Co-authored-by: Caleb <[email protected]>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Emma Smith <[email protected]>
Co-authored-by: Jason R. Coombs <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jaraco jaraco jaraco approved these changes
@emmatyping emmatyping emmatyping left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@ctrlaltf2 @Wulian233 @emmatyping @jaraco
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.