Skip to content

Negative timestamp failure during DST on Windows #145731

Closed

Description

@hugovk

Bug report

Bug description:

The AMD64 Windows10 3.x buildbot has started failing:

======================================================================
FAIL: test_fromtimestamp_low_fold_detection (test.datetimetester.TestLocalTimeDisambiguation_Fast.test_fromtimestamp_low_fold_detection)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\datetimetester.py", line 6431, in test_fromtimestamp_low_fold_detection
    self.assertEqual(datetime.fromtimestamp(0).fold, 0)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 1 != 0
======================================================================
FAIL: test_mktime (test.test_time.TimeTestCase.test_mktime)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_time.py", line 542, in test_mktime
    self.assertEqual(t1, t)
    ~~~~~~~~~~~~~~~~^^^^^^^
AssertionError: 3598.0 != -2

----------------------------------------------------------------------
Ran 64 tests in 3.432s

The US switched to DST on Sunday 8th March.

Only this Windows buildbot fails, it's on EST/EDT:

Last pass:

  • datetime.datetime.now: 2026-03-07 09:09:35 (local)
  • time.time: 1772892576 → 2026-03-07 14:09:36 UTC
  • Offset: 5 hours → UTC-5 → EST

First fail:

  • datetime.datetime.now: 2026-03-08 23:01:25 (local)
  • time.time: 1773025286 → 2026-03-09 03:01:26 UTC
  • Offset: 4 hours → UTC-4 → EDT

GitHub Actions is on UTC, so it passes.

Bug likely introduced by #143463, merged in January during standard time, so the tests passed.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    stdlibStandard Library Python modules in the Lib/ directory
    on Mar 10, 2026
  2. added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    and removed
    stdlibStandard Library Python modules in the Lib/ directory
    on Mar 10, 2026
  3. added a commit that references this issue on Mar 10, 2026
  4. added a commit that references this issue on Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowsinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions