-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #544: Port to Python 3.14 #545
Conversation
vstinner
commented
Dec 4, 2024
- _getattribute() API changed in Python 3.14.
- itertools.count() no longer supports pickle on Python 3.14: https://docs.python.org/dev/whatsnew/3.14.html#itertools
- Fix annotations test.
_getattribute() API changed in Python 3.14: see python/cpython@1bb955a. |
* _getattribute() API changed in Python 3.14. * itertools.count() no longer supports pickle on Python 3.14: https://docs.python.org/dev/whatsnew/3.14.html#itertools * Fix annotations test.
I didn't add |
Why simply not add the own implementation of |
Python 3.13: def _getattribute(obj, name):
top = obj
for subpath in name.split('.'):
if subpath == '<locals>':
raise AttributeError("Can't get local attribute {!r} on {!r}"
.format(name, top))
try:
parent = obj
obj = getattr(obj, subpath)
except AttributeError:
raise AttributeError("Can't get attribute {!r} on {!r}"
.format(name, top)) from None
return obj, parent Python 3.14: def _getattribute(obj, dotted_path):
for subpath in dotted_path:
obj = getattr(obj, subpath)
return obj I don't know which implementation is the best, I don't know the cloudpickle project, so I prefer to continue calling what's available in At least, I can say that Python 3.14 implementation is the simplest :-) |
Ping @ogrisel. |
Hum I need to investigate why the CI is no longer running on PRs. |
For some reason, the github actions workflow approval button does no longer show up on the PR itself, but it still shows up in the github actions tab. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix. I added a 3.14 config to the CI and all tests pass.
@unittest.skipIf( | ||
sys.version_info >= (3, 14), | ||
"itertools.count() doesn't support pickle on Python 3.14+", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vstinner isn't that considered a regression? Why wouldn't such a simple object not be picklable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a deliberate change: https://docs.python.org/dev/whatsnew/3.14.html#itertools