Message348237
https://bugs.python.org/issue5288 changed datetime.timezone to accept sub-minute offsets.
The C implementation allows offsets from range (23:59, 24:00) while the python implementation does not:
# C
>>> timezone(timedelta(seconds=86399))
datetime.timezone(datetime.timedelta(seconds=86399))
# Python
>>> timezone(timedelta(seconds=86399))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "cpython/Lib/datetime.py", line 2194, in __new__
raise ValueError("offset must be a timedelta "
ValueError: offset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24).
This is because _maxoffset is defined as timedelta(hours=23, minutes=59)
Second issue: The (undocumented) "min" and "max" attributes (both C and python) show 23:59
even though the C implementation can get closer to 24:00.
Should this be changed to timezone(timedelta(seconds=86399, microseconds=999999))?
(Same applies to the minimums) |
|
Date |
User |
Action |
Args |
2019-07-21 11:41:24 | joernheissler | set | recipients:
+ joernheissler |
2019-07-21 11:41:24 | joernheissler | set | messageid: <1563709284.19.0.651842013894.issue37642@roundup.psfhosted.org> |
2019-07-21 11:41:24 | joernheissler | link | issue37642 messages |
2019-07-21 11:41:23 | joernheissler | create | |
|