Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

fix: support Python 3.12 #458

wants to merge 2 commits into from

Conversation

okainov
Copy link

@okainov okainov commented Nov 4, 2024

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)

@allburov
Copy link
Member

allburov commented Nov 5, 2024

I haven't done any testing

All tests failed :(

AttributeError: 'super' object has no attribute 'parse_parts'

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
Copy link
Member

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

Copy link
Contributor

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.

@gsemet
Copy link
Contributor

gsemet commented Nov 19, 2024

would be helpful to support 3.12 ! Thanks !

@stott531
Copy link

What's the status on this PR? It looks like it hasn't been updated in a couple weeks

@allburov
Copy link
Member

What's the status on this PR?

The build has failed, as I can see.
We can not accept changes if it doesn't pass tests anyway :(

@@ -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:
Copy link
Contributor

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+?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants