[New-bugs-announce] [issue42025] zoneinfo: fold not taken into account in time difference when tzinfo is equal

David Grellscheid report at bugs.python.org
Tue Oct 13 05:01:16 EDT 2020


New submission from David Grellscheid <d.grellscheid at gmail.com>:

I'm comparing two aware timestamps during a clock transition that differ only in their fold= value.

When taking the difference of two aware timestamps with the *same* tzinfo, the fold parameter is ignored. 

A difference between two timestamps with different tzinfo works correctly, with fold taken into account.

For the attached code I would expect all timedeltas to be the same, but I get:

0:00:00 Oslo_1   - Oslo_0
1:00:00 Berlin_1 - Oslo_0
1:00:00 Oslo_1   - Berlin_0
0:00:00 Berlin_1 - Berlin_0

----------
components: Library (Lib)
files: fold_bug.py
messages: 378545
nosy: d.grellscheid
priority: normal
severity: normal
status: open
title: zoneinfo: fold not taken into account in time difference when tzinfo is equal
versions: Python 3.9
Added file: https://bugs.python.org/file49514/fold_bug.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42025>
_______________________________________


More information about the New-bugs-announce mailing list