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

can't compatible with configparser #42

Open
kyanite opened this issue Aug 3, 2016 · 2 comments
Open

can't compatible with configparser #42

kyanite opened this issue Aug 3, 2016 · 2 comments

Comments

@kyanite
Copy link

kyanite commented Aug 3, 2016

the library depends on pathlib, but it seems can't work if configparser installed.

File "xxxxx/lib/python2.7/site-packages/artifactory.py", line 311, in parse_parts
drv, root, parsed = super(_ArtifactoryFlavour, self).parse_parts(parts)
File "xxxxx/lib/python2.7/site-packages/pathlib.py", line 90, in parse_parts
parsed.append(intern(x))
TypeError: intern() argument 1 must be string, not unicode

@cowlinator
Copy link

I was able to workaround this with the following code:

import artifactory
# fix for bug in artifactory module, caused by unicode/str issues
artifactory.read_global_config()
new_config = {}
for section in artifactory.global_config:
    new_config[str(section)] = artifactory.global_config[section]
    artifactory.global_config[section] = None
artifactory.global_config = new_config

Not optimal, but functional.

@danielsliu8
Copy link

I was able to fix this locally by modifying artifactory.py itself. Pretty much a hack, but looks like this repo isn't being updated anymore, so you probably won't miss out on updates.

On line 354, in the splitroot() function, replace
return drv, root, part
with
return str(drv), str(root), str(part)

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

3 participants