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

Python 3.12 - AttributeError: module 'pathlib' has no attribute '_Flavour' #430

Open
briantist opened this issue Aug 13, 2023 · 17 comments
Open
Labels
enhancement Feature request to extend functionality hacktoberfest Help Wanted We will be glad if somebody proposes a solution via PR

Comments

@briantist
Copy link
Contributor

briantist commented Aug 13, 2023

Python 3.12 is now released, but it does not work due to pathlib changes:

/opt/hostedtoolcache/Python/3.12.0-rc.1/x64/lib/python3.12/site-packages/artifactory.py:426: in
class _ArtifactoryFlavour(pathlib._Flavour):
E AttributeError: module 'pathlib' has no attribute '_Flavour'

I figured I'd add 3.12 into the test matrix on my project which relies on this library, and that's how I found this issue:

Not any kind of pressing issue yet.

@allburov allburov added the enhancement Feature request to extend functionality label Aug 14, 2023
@allburov
Copy link
Member

Thank you for the feedback!
If anyone has idea how to fix this - feel free to create a PR

@brot
Copy link

brot commented Sep 4, 2023

Python 3.12 will add support for subclassing pathlib.PurePath and Path

See also the cpython github issue: python/cpython#31691

@barneygale
Copy link

I'm hoping to add a pathlib.PathBase class for Python 3.13. Once it's in the codebase, I'll publish a backport package on PyPI for Python <3.13. dohq-artifactory could subclass PathBase to implement ArtifactoryPath.

CPython issue: python/cpython#110109

@allburov allburov added the Help Wanted We will be glad if somebody proposes a solution via PR label Oct 10, 2023
@briantist briantist changed the title Python 3.12 (pre-release) - AttributeError: module 'pathlib' has no attribute '_Flavour' Python 3.12 - AttributeError: module 'pathlib' has no attribute '_Flavour' Nov 20, 2023
@ktdreyer
Copy link
Contributor

ktdreyer commented Dec 8, 2023

@barneygale Thank you for your work in core for this. It will be great to simplify the dohq-artifactory codebase.

Do you suggest any other solution for py312 in the meantime? Should we try subclassing something from py312's pathlib prior to pathlib.PathBase being available?

I'm running Python 3.12 on my laptop (Fedora 39), and I've hacked artifactory.py so that it doesn't crash. I can list directories and download and upload basic files. My changes are in my py312 branch, but I'm not sure they're acceptable for a PR here.

@barneygale
Copy link

I'd recommend that you wait if you can - I'm expecting to publish a PyPI package with the base classes some time this month.

@barneygale
Copy link

Git project: https://github.com/barneygale/pathlib_abc

Currently it only supports Python 3.11+, but I should have it working for 3.8+ within a couple of weeks, at which point I'll publish a PyPI package.

@barneygale
Copy link

First PyPI release: https://pypi.org/project/pathlib-abc/0.1.0/

@FHTMitchell
Copy link

I'm seeing the same issue in py3.11 now

@dkmiller
Copy link

dkmiller commented Feb 5, 2024

Hey everyone - any progress here?

@zhan9san
Copy link
Contributor

zhan9san commented Feb 6, 2024

Hey guys,

Thanks for reporting this issue. I'd like to work on it.

@barneygale
Copy link

barneygale commented Feb 24, 2024

IMO the best way to fix this is to add a dependency on pathlib-abc, and make ArtifactoryPath inherit from PathBase.

@zhan9san is that what you're pursuing? If not I might have a crack at it.

@lukezhangtyler
Copy link

I hope this will be remediated soon.

@okainov
Copy link

okainov commented Mar 19, 2024

@zhan9san @beliaev-maksim hi folks, any update on this issue? Given Python 3.12 is fully released and supported, it would be very appreciated that Artifactory library supports it, it's the only item blocking our migration to 3.12 now...

@allburov
Copy link
Member

We are looking for a volunteer!

@andrewsiemer
Copy link

+1 this is blocking migrating to python 3.12

@hacklint
Copy link

hacklint commented May 3, 2024

Any hope of this being resolved before release of python 3.13?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request to extend functionality hacktoberfest Help Wanted We will be glad if somebody proposes a solution via PR
Development

No branches or pull requests