aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

s3 sync/ls issues UnicodeWarning in Windows environment

Open quiver opened this issue 13 years ago • 30 comments

What steps will reproduce the problem?

  1. Log in to Windows(default language is non English(confirmed on Japanese))
  2. 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)

quiver avatar Oct 21 '13 03:10 quiver

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

ksdev-pl avatar Dec 03 '13 18:12 ksdev-pl

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

eerien avatar Feb 18 '14 09:02 eerien

+1. Russian. Seems locale-related.

skaurus avatar Aug 01 '14 23:08 skaurus

+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

JoernBerkefeld avatar Jul 30 '15 09:07 JoernBerkefeld

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.

quiver avatar Aug 11 '15 06:08 quiver

+1 russian on CLI 1.9.7, Pyphon 2.7.9, Botocore 1.3.7, Win7 - @ 428.

Kainax avatar Nov 21 '15 14:11 Kainax

Hello there,

you guys can try to use " " instead ' ' between text clauses for example.

gustavohc91 avatar Jan 26 '16 19:01 gustavohc91

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 avatar Nov 24 '16 01:11 Kainax

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

rmsys avatar Nov 25 '16 18:11 rmsys

three years! I can't believe that wasn't fixed.

How can I overpass this issue?

arthurcohen avatar Dec 01 '16 20:12 arthurcohen

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

souzabrunoftw avatar Dec 05 '16 12:12 souzabrunoftw

Any chance somebody is gonna fix it?

souzabrunoftw avatar Dec 12 '16 17:12 souzabrunoftw

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.

arthurcohen avatar Dec 12 '16 17:12 arthurcohen

+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

vparmeland avatar Dec 30 '16 13:12 vparmeland

Same problem with Windows 10 French. I am very very discouraged.

ghost avatar Jan 05 '17 08:01 ghost

Up ?

vparmeland avatar Jan 12 '17 09:01 vparmeland

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

lenew avatar Jan 17 '17 04:01 lenew

I'm experiencing the same issue:

aws-cli/1.11.37 Python/2.7.9 Windows/8 botocore/1.5.0

enricforn avatar Jan 17 '17 21:01 enricforn

+1 Chinese

Sdcxv avatar Mar 07 '17 08:03 Sdcxv

+1 Korean

statkclee avatar Mar 22 '17 07:03 statkclee