jesseward/discogstagger — Issue #2: URL double encoded
Author: cmaussan
Created: 2012-02-14 10:19:22+00:00
State: open

Hi Jesse,

I have an other issue with discostagger :/
When I try this command line :

python ~/code/ext/discogstagger/discogs_tagger.py -r 3406100 -s Nordic\ by\ Night

I get this result :

INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): api.discogs.com
DEBUG:requests.packages.urllib3.connectionpool:"GET /release/3406100 HTTP/1.1" 200 2225
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): api.discogs.com
DEBUG:requests.packages.urllib3.connectionpool:"GET /artist/Lindstr%25C3%25B8m HTTP/1.1" 404 75
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): api.discogs.com
DEBUG:requests.packages.urllib3.connectionpool:"GET /artist/Lindstr%25C3%25B8m HTTP/1.1" 404 75
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): api.discogs.com
DEBUG:requests.packages.urllib3.connectionpool:"GET /artist/Lindstr%25C3%25B8m HTTP/1.1" 404 75
Traceback (most recent call last):
File "/home/cmaussan/code/ext/discogstagger/discogs_tagger.py", line 484, in
logging.info("Tagging album '%s - %s'" % (release.artist, release.title))
File "/home/cmaussan/code/ext/discogstagger/discogs_tagger.py", line 141, in artist
return self.clean_name(artist.data['name'])
File "/home/cmaussan/code/ext/discogstagger/discogs_client.py", line 90, in data
raise HTTPError(status_code)
discogs_client.HTTPError: HTTP status 404: Not Found.

I can see it's because of the double encoding in URL. The GET should be /artist/Lindstr%C3%B8m and it's actually /artist/Lindstr%25C3%25B8m. I tryed to comment the urllib.quote( of line 81 in discogs_client.py but nothing changed :(
Maybe it's in requests.get ...

Do you have any idea ?

Thanks,

Camille.