Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

small fix for quote vs quote_plus #11

Merged
merged 1 commit into from

2 participants

@jesseward

The upstream requests library has caused a few issues over the last month. Namely URL escaping of special characters.

This is now fixed. I believe requests lib 10.1 -> 10.3 should be considered "broken"
See
kennethreitz/requests#404
kennethreitz/requests#437

This pull requests includes a very small change to the way the client encodes urls. Substituting quote() for quote_plus() (discogs uses the + for slugs)

See

http://docs.python.org/library/urllib.html#urllib.quote

"Like quote(), but also replaces spaces by plus signs, as required for quoting HTML form values when building up a query string to go into a URL. Plus signs in the original string are escaped unless they are included in safe. It also does not have safe default to '/' "

@vreon vreon merged commit bfdb1f9 into discogs:master
@vreon
Owner

Much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 21, 2012
  1. small fix for quote vs quote_plus

    Jesse Ward authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  discogs_client.py
View
2  discogs_client.py
@@ -78,7 +78,7 @@ def _uri_name(self):
@property
def _uri(self):
- return '%s/%s/%s' % (api_uri, self._uri_name, urllib.quote(unicode(self._id).encode('utf-8')))
+ return '%s/%s/%s' % (api_uri, self._uri_name, urllib.quote_plus(unicode(self._id).encode('utf-8')))
@property
def data(self):
Something went wrong with that request. Please try again.