Parallels / artifactory

A Python client for Artifactory
MIT License
82 stars 54 forks source link

can't compatible with configparser #42

Open kyanite opened 8 years ago

kyanite commented 8 years ago

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 commented 6 years ago

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 commented 5 years ago

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)