s3 sync/ls issues UnicodeWarning in Windows environment
What steps will reproduce the problem?
- Log in to Windows(default language is non English(confirmed on Japanese))
- Run `aws s3 ls s3:://bucketname/
What is the expected output? What do you see instead?
You will encounter UnicodeWarning as follows;
Bucket: bucketname
Prefix:
LastWriteTime Length Name
------------- ------ ----
PRE /
PRE test/
C:\Program Files\Amazon\AWSCLI\.\dateutil\parser.py:336: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
2013-10-19 17:37:54 20 foobar
...
What version of the product are you using?
C:\>aws --version
aws-cli/1.2.0 Python/2.7.5 Windows/7
Additional information below.
This is not a bug of aws-cli per se and is already reported to python-dateutils. https://bugs.launchpad.net/dateutil/+bug/1227221
But you encounter this warning every time you issue s3 commands, so it's a bit annoying.(awscli users are not always (Python) developers, right?)
Working around this warning would be appreciated. (When releasing awscli, suppressing warning with python -W ignore::UnicodeWarning is one option)
FYI, this warning also appears in #95(Which occurred in argparse module)
Same here (system language - Polish).
aws-cli/1.2.6 Python/2.7.5 Windows/7
c:\> aws s3 ls s3://bucket.pl
C:\Program Files\Amazon\AWSCLI\.\dateutil\parser.py:339: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
2013-12-02 21:23:32 612 filename
I have same issue. (System language - Korean)
$ aws s3 ls
c:\Program Files\Amazon\AWSCLI\.\dateutil\parser.py:339: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
+1. Russian. Seems locale-related.
+1 german Win7, exactly the same message as eerien posted it after aws s3 sync s3://xxx s3://yyy
apart from the line being 428
aws-cli/1.7.41 Python/2.7.9 Windows/7
I found another workaround.
This issue is Python2(unicode nightmare!) specific and aws-cli installer is affected because it comes with Python 2.7.
So instead of the aws-cli bundled installer, first download Python3 and install aws-cli with $ pip install awscli.
Now you have no warnings :-)
On a side note, dateutil guys seem to have fixed the inherent bug:
- https://bugs.launchpad.net/dateutil/+bug/1227221
- dateutil/dateutil/issues/92
Hope this will solve the problem in the near future.
+1 russian on CLI 1.9.7, Pyphon 2.7.9, Botocore 1.3.7, Win7 - @ 428.
Hello there,
you guys can try to use " " instead ' ' between text clauses for example.
More than one year past, and we still can't sync normally. Just reinstalled system from scratch, and still the same music.
aws --version aws-cli/1.11.20 Python/2.7.9 Windows/8 botocore/1.4.77 (actually Windows 10, Russian)
C:\Program Files\Amazon\AWSCLI.\dateutil\parser.py:605: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
Fix it, please!
Kainax you are right. More than one year!
aws --version aws-cli/1.11.21 Python/2.7.9 Windows/8 botocore/1.4.78 (actually Windows 10)
C:\Program Files\Amazon\AWSCLI.\dateutil\parser.py:605: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
three years! I can't believe that wasn't fixed.
How can I overpass this issue?
Hi, I'm having the same issue.
aws --version aws-cli/1.11.21 Python/2.7.9 Windows/8 botocore/1.4.78 Windows 10
Trying to sync a local folder to a S3 bucket.
C:\Program Files\Amazon\AWSCLI.\dateutil\parser.py:605: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
Any chance somebody is gonna fix it?
well, my problem occurs when i use a boto3 package from python, that access the AWS CLI internally.
I solved this Warning putting this warning simple filter:
warnings.simplefilter("ignore", UnicodeWarning)
But I do not know how to solve this on AWS CLI, sorry guys.
+1 French
aws --version aws-cli/1.11.35 Python/2.7.9 Windows/2012Server botocore/1.4.92
CLI x64 Windows Server 2012 R2
Same problem with Windows 10 French. I am very very discouraged.
Up ?
Same problem with windows 10 zh-CN. aws-cli/1.11.37 Python/2.7.9 Windows/8 botocore/1.5.0
Solved this problem by change dateutil with python-dateutil source code, and change parser.py at line 605 from
elif res.tzname and res.tzname in time.tzname:
to
elif res.tzname and res.tzname in [x.decode(sys.stdout.encoding) for x in time.tzname]:
and dont forget insert import sys at the head of this file
I'm experiencing the same issue:
aws-cli/1.11.37 Python/2.7.9 Windows/8 botocore/1.5.0
+1 Chinese
+1 Korean