-
Notifications
You must be signed in to change notification settings - Fork 148
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: support Python 3.12 #458
base: master
Are you sure you want to change the base?
Conversation
Apply path proposed in devopshq#430 See: devopshq#430
All tests failed :(
|
else: | ||
# in 3.9 and below Pathlib limits what members can be present in 'Path' class | ||
__slots__ = ("auth", "verify", "cert", "session", "timeout") | ||
|
||
|
||
def __init__(self, *args, **kwargs): | ||
# supplying keyword arguments to pathlib.PurePath is deprecated |
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.
I assume we should not silently suppress the kwargs
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.
Agreed. We should just axe this override, as you're passing via args below anyway.
would be helpful to support 3.12 ! Thanks ! |
What's the status on this PR? It looks like it hasn't been updated in a couple weeks |
The build has failed, as I can see. |
@@ -1514,6 +1519,10 @@ def __new__(cls, *args, **kwargs): | |||
only then add auth information. | |||
""" | |||
obj = pathlib.Path.__new__(cls, *args, **kwargs) | |||
|
|||
if sys.version_info.major == 3 and sys.version_info.minor >= 12: |
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.
We should not have version specific behaviour if this can be avoided. If positional arguments can be passed in all supported earlier versions, then we should be doing it for all versions.
Why is __init__
only being called here for 3.12+?
Apply path proposed in #430 by @RoccoMatano
I haven't done any testing, just making the proposed path in PR format.
See: #430, #430 (comment)