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

2020-10-13 Thread David Grellscheid


David Grellscheid  added the comment:

To make it clear that this issue is not covered by ...

"Two such instances that differ only by the value of the fold attribute will 
not be distinguishable by any means other than an explicit access to the fold 
value." (PEP 495)

I have modified the timestamps by one minute, so that they differ in more than 
just the fold attribute.

All these should be 1:01:00 apart
0:01:00 Oslo_1   - Oslo_0
1:01:00 Berlin_1 - Oslo_0
1:01:00 Oslo_1   - Berlin_0
0:01:00 Berlin_1 - Berlin_0

--
Added file: https://bugs.python.org/file49516/fold_bug_1minute.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2020-10-13 Thread David Grellscheid


New submission from David Grellscheid :

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com