boto/boto — pull request #2656 by gfemec (2014-10-03 19:19:33+00:00)
Title: Fix unicode support in query strings for Python2.x

Passing a decoded string to urllib.quote can cause stack traces like this

```
...
File "./venv/lib/python2.7/site-packages/boto/connection.py", line 1053, in make_request
retry_handler=retry_handler)
File "./venv/lib/python2.7/site-packages/boto/connection.py", line 911, in _mexe
request.authorize(connection=self)
File "./venv/lib/python2.7/site-packages/boto/connection.py", line 375, in authorize
connection._auth_handler.add_auth(self, **kwargs)
File "./venv/lib/python2.7/site-packages/boto/auth.py", line 511, in add_auth
canonical_request = self.canonical_request(req)
File "./venv/lib/python2.7/site-packages/boto/auth.py", line 400, in canonical_request
cr.append(self.canonical_query_string(http_request))
File "./venv/lib/python2.7/site-packages/boto/auth.py", line 348, in canonical_query_string
urllib.parse.quote(value.decode('utf-8'), safe='-_.~')))
File "/usr/lib64/python2.7/urllib.py", line 1282, in quote
return ''.join(map(quoter, s))
KeyError: u'\xe9'
```

I think this was just an oversight from 96cd280 . In Python 3 urllib.parse.quote works with either, but Python2.x needs the value to be encoded already.

https://docs.python.org/3.3/library/urllib.parse.html#urllib.parse.quote
https://docs.python.org/2.7/library/urllib.html#urllib.quote