boto/botocore — pull request #412 by kyleknap (2014-12-11 01:30:46+00:00)
Title: Fix url encoding of canonical query string

Fixes https://github.com/aws/aws-cli/issues/1046

The issue was that when we generate the sigv4 canonical query string. We take it from either two places: the parameters or the actual query string. We also have two different code paths for forming the canonical query string for those two different locations. In this case, the bug is when we form the canonical query string from the actual query string.

Based on the botocore code we actually already encode the utf-8 encode and then url encode the query string when we make the request:
https://github.com/boto/botocore/blob/develop/botocore/endpoint.py#L144

So when we pull out the different components to form the canonical query string we do not have to do any more decoding and re-encoding because it is already in the correct form. The correct form being:
```
my_unicode = u'foo=bar&baz=biz'
safe_chars = '-._~'
quote(my_unicode.encode('utf-8'), safe_chars)

```

cc @jamesls @danielgtaylor