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

ArtifactoryPath is broken. #69

Open
sngreen opened this issue Jun 4, 2019 · 8 comments
Open

ArtifactoryPath is broken. #69

sngreen opened this issue Jun 4, 2019 · 8 comments

Comments

@sngreen
Copy link

sngreen commented Jun 4, 2019

artifact = ArtifactoryPath( url, auth=auth)
changes https://whatever... to https:/whatever... (removing one forward slash) after which the library renders unusable.

@jhuels
Copy link

jhuels commented Nov 20, 2019

Same issue here

EDIT: This is due to an update in pathlib

@figadore
Copy link

figadore commented Nov 27, 2019

Running into this as well. My problem comes from

mark = sep+'artifactory'+sep

which assumes that the base url has the literal string artifactory in the name, but this is only the case when the server config's "server name" property is set to artifactory. In all other cases, it will produce the output described by @sngreen

My workaround is to create a ~/.artifactory_python.cfg file with the contents:

[https://whatever.com/myservername]
verify=True

@sfoley-gpqa
Copy link

I wasn't able to get the workaround above to work in Python 3.10. It looks like the pathlib package removed the _init() method that facilitated being able to use template "accessors" in python 3.10. This means that the artifactory package only ever gets pathlib._NormalAccessor objects instead of the desired _ArtifactoryAccessor. The result of this is that, when the user tries to do anything with an ArtifactoryPath object, it results in a FileNotFoundError because a _NormallAccessor is designed to work with the local file system--which is obviously not how one interacts with Artifactory.

@ravimehta295
Copy link

If we use Pathlib2, it is working fine for me.

@drohm
Copy link

drohm commented Aug 1, 2024

@sfoley-gpqa did you ever get around that error? I'm experiencing a similar issue when trying to upload a file to Artifactory I'm getting:

'_NormalAccessor' object has no atribute 'is_dir'

Do we know of any way to get around this?

@sfoley-gpqa
Copy link

@drohm

I won't lie; I'm having trouble remembering the exact details of the problem I was experiencing at the time of my last post. I think I may have reverted to using python 3.9.x to solve the problem.

That said, I am currently using 3.10.13 for my project and am able to successfully upload files to Artifactory using ArtifactoryPath(url, auth=(ssid, api_key)).

I still see that Python 3.10's pathlib lacks the _init() method. However, I also see some 3.9 vs 3.10 version comparison logic in the artifactory package. I'm not sure if that is a new addition or not though and do not have time to check right now.

What version of python are you using? I know how this kind of thing can be very frustrating--especially when no one responds--so I'd be happy to help in any way I can.

@drohm
Copy link

drohm commented Aug 19, 2024

@sfoley-gpqa sorry for the delay, I ended up just installing Python 3.9 on this machine. I'm using this on Ubuntu 22.04 and the default version is Python 3.10, which was what was giving me the problems. I used the deadsnakes PPA to install Python 3.9 and everything is working.

@sfoley-gpqa
Copy link

I'm glad to hear that it's working for you now!

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

No branches or pull requests

6 participants