aws/aws-cli — pull request #1038 by kyleknap (2014-12-02 00:08:58+00:00)
Title: Add ability for skipping undecodable filenames

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

So if you are running on posix platforms you will run into an issue if the file name was encoded differently than the system's set encoding, the ``listdir()`` call we make will not be able to decode the name properly.

Before, if you hit this problem the whole process failed and it would do so silently. Now it warns the user with the appropriate message and just skips the file.

Here is an example of reproducing the fixed issue on an Amazon Linux, and what it looks like with this PR:
```
$ ls
hello.py zz.py

$ python
Python 2.6.9 (unknown, Sep 13 2014, 00:25:11)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> with open(u'\u00C0'.encode('latin1'), 'wb') as f:
... f.write('foo')

$ aws s3 cp . s3://mybucketfoo --recursive
warning: Skipping file '\xc0'. There was an error trying to decode the the file '\xc0' in directory "/home/ec2-user/temp/".
Please check your locale settings. The filename was decoded as: UTF-8
On posix platforms, check the LC_CTYPE environment variable.
upload: ./zz.py to s3://mybucketfoo/zz.py
upload: ./hello.py to s3://mybucketfoo/hello.py

$ echo $?
2
```

cc @jamesls @danielgtaylor