aws/aws-cli — pull request #700 by jamesls (2014-03-13 00:18:52+00:00)
Title: Use encoding-type when listing objects for s3 transfers

Fixes #675.

The issue is that the builtin XML parser in python is converting `\r` to `\n` which makes it impossible to delete keys with those characters in the key name when using either `--recursive` or `sync`, because these commands rely on parsing the output of `ListObjects`.

This uses the `encoding_type` param to force urlencoding so that we can get the key names unprocessed and urldecode them ourselves.

I want to do more testing to look at the performance characteristics. At least from a micro-benchmark perspective, there's an overhead of:

```
# python2
$ python -m timeit -s 'from botocore.compat import unquote_str' 'unquote_str("%E2%9C%93")'
100000 loops, best of 3: 7.91 usec per loop
# python3
$ python -m timeit -s 'from botocore.compat import unquote_str' 'unquote_str("%E2%9C%93")'
100000 loops, best of 3: 10.5 usec per loop
```

Which for 1000 keys at a time is ~8ms and ~10ms respectively.