CI: enable python3.15 job - #66473
Conversation
8ff4eb3 to
99aeb80
Compare
99aeb80 to
837505f
Compare
| tz = parse_timezone_directive(group_val) | ||
| if group_val: | ||
| tz = parse_timezone_directive(group_val) |
There was a problem hiding this comment.
This follows python/cpython#132922. It changed the behavior to make the %z format optional.
$ cmd='import datetime; print(datetime.datetime.strptime("2010-01-01 12:00:00", "%Y-%m-%d %H:%M:%S%z"))'
$ /usr/bin/python3.14 -c "$cmd"
Traceback (most recent call last):
File "<string>", line 1, in <module>
import datetime; print(datetime.datetime.strptime("2010-01-01 12:00:00", "%Y-%m-%d %H:%M:%S%z"))
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.14/_strptime.py", line 815, in _strptime_datetime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.14/_strptime.py", line 555, in _strptime
raise ValueError("time data %r does not match format %r" %
(data_string, format))
ValueError: time data '2010-01-01 12:00:00' does not match format '%Y-%m-%d %H:%M:%S%z'
$ ~/opt/python315-asan/bin/python3.15 -c "$cmd"
2010-01-01 12:00:00Is this change correct, or we should be raising an error in case group_val is None?
There was a problem hiding this comment.
My instinct is that we should not be following the stdlib on this because it can lead to weird behavior in mixed-input cases. But I need to look into the consequences more closely before giving a strong opinion.
There was a problem hiding this comment.
I think we should do something like
if group_val is None:
raise ValueError(f"time data \"{val}\" doesn't match format \"{fmt}\"")
tz = parse_timezone_directive(group_val)
There was a problem hiding this comment.
then we keep the existing behavior
The offset in format (%z) became optional in CPython 3.15.
837505f to
ba1a401
Compare
| msg = "index (0|0.5) is out of bounds for axis 0 with size 0" | ||
| else: | ||
| msg = "slice indices must be integers or None or have an __index__ method" | ||
| msg = ( |
There was a problem hiding this comment.
can we condition this on PY315 so that we can eventually simplify it
There was a problem hiding this comment.
Check if it's better now. The only place where I didn't apply the conditional was in test_constructor_keyword, but added a comment to compensate.
| us = int(s) | ||
| ns = us % 1000 | ||
| us = us // 1000 | ||
| # elif group_key == 'A': |
There was a problem hiding this comment.
23 corresponds to "N" in _parse_code_table. I think several of these are off
There was a problem hiding this comment.
Removed the elif above it, since it's not present in CPython's code. Thanks for pointing it out.
|
Does |
It was raising KeyError because |
Seems that the error message "Cannot convert None to Decimal" only occurs on linux.
doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature.AGENTS.md.