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

Add python 3.11 support: Remove use of pathlib._Accessor #88

Closed
wants to merge 2 commits into from

Conversation

wookayin
Copy link

@wookayin wookayin commented Nov 10, 2022

Changes

  • Remove use of pathlib._Accessor.
  • Add python 3.10 and 3.11 tests to CI.

Python 3.11 has removed a non-public method pathlib._Accessor: python/cpython#25701.

Accessor-style classes in pathlib are discouraged, but a simple fix here to make pathy work is to simply remove the deprecated superclass _Accessor.

`pathlib._Accessor` was deprecated and has been removed since
Python 3.11, which was making pathy not importable on Python 3.11.

Accessor-style classes in pathlib are discouraged, but a simple fix
here to make pathy work is to simply remove the deprecated
superclass `_Accessor`.
@justindujardin
Copy link
Owner

@wookayin, thanks so much for reporting that Python 3.11 was not working, and thanks for offering a PR! Unfortunately, Pathy relies on the base pathlib internals for glob matching, so it's not as simple as removing the _Accessor usage. I merged support for 3.11 today if you'd like to see how it had to change: c2a0586

Ideally, we would not rely on the internals of pathlib at all, but that would require adding code to replace the wildcard matching scandir functionality in pathlib.Path. I haven't had time to do that work, but if you'd like to contribute that would be a very welcomed PR.

@wookayin
Copy link
Author

@justindujardin Thanks! Awesome to see more dedicated python3.11 support (#89).

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

Successfully merging this pull request may close these issues.

2 participants