justindujardin / pathy

simple, flexible, offline capable, cloud storage with a Python path-like interface
Apache License 2.0
171 stars 23 forks source link

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

Closed wookayin closed 1 year ago

wookayin commented 1 year ago

Changes

Python 3.11 has removed a non-public method pathlib._Accessor: https://github.com/python/cpython/pull/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.

justindujardin commented 1 year ago

@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: https://github.com/justindujardin/pathy/commit/c2a0586c198a19cf6fcf81b41c60689af574db17

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 commented 1 year ago

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