-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Open
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirstdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Add one microsecond to datetime with fold=1 and this fold is cleanup and we go to the past instead of go to one microsecond ahead
from datetime import datetime, timedelta
from zoneinfo import ZoneInfo
tz = ZoneInfo('Europe/Paris')
dt1 = datetime(2025, 10, 26, 2, 0, 1, tzinfo=tz)
print(dt1)
dt2 = datetime(2025, 10, 26, 2, 0, 1, fold=1, tzinfo=tz)
print(dt2)
dt3 = dt2 + timedelta(microseconds=1)
print(dt3)
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Metadata
Metadata
Assignees
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirstdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
No status