Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode issues with non-ascii chars in home path #2395

Closed
alex88 opened this issue Jan 19, 2017 · 7 comments · Fixed by boto/botocore#1170
Closed

Unicode issues with non-ascii chars in home path #2395

alex88 opened this issue Jan 19, 2017 · 7 comments · Fixed by boto/botocore#1170
Labels
bug This issue is a bug.

Comments

@alex88
Copy link

alex88 commented Jan 19, 2017

I had to install aws-cli on a Turkish pc running windows 7 with the user's home folder called İK and I get this output

C:\Users\İK>aws
Traceback (most recent call last):
  File "aws", line 27, in <module>
  File "aws", line 23, in main
  File "awscli\clidriver.pyc", line 53, in main
  File "awscli\clidriver.pyc", line 61, in create_clidriver
  File "botocore\session.pyc", line 375, in full_config
  File "botocore\configloader.pyc", line 105, in load_config
  File "botocore\configloader.pyc", line 145, in raw_config_parse
  File "botocore\exceptions.pyc", line 27, in __init__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xdd in position 9: ordinal not in range(128)

could it be something related to the user's folder name?

I've tried also with --debug but I've the same issue

@kyleknap
Copy link
Contributor

@alex88
Yeah looks the initializer for that exception does not correctly handle unicode, which blows up the config/credential loading process because it is expecting for a ConfigNotFound to be raised. I have not reproduced this yet but could you include the complete debug logs to help us look into it?

@kyleknap kyleknap added response-needed bug This issue is a bug. labels Jan 19, 2017
@alex88
Copy link
Author

alex88 commented Jan 19, 2017

Hi @kyleknap where can I find the debug logs? Using --debug after the command provides the same output

@alex88
Copy link
Author

alex88 commented Jan 19, 2017

Just a quick test on my OSX machine

➜  İK export HOME=/tmp/İK
➜  ~ pwd
/tmp/İK
➜  ~ aws
Traceback (most recent call last):
  File "/usr/local/bin/aws", line 27, in <module>
    sys.exit(main())
  File "/usr/local/bin/aws", line 23, in main
    return awscli.clidriver.main()
  File "/usr/local/Cellar/awscli/1.11.37/libexec/lib/python2.7/site-packages/awscli/clidriver.py", line 53, in main
    driver = create_clidriver()
  File "/usr/local/Cellar/awscli/1.11.37/libexec/lib/python2.7/site-packages/awscli/clidriver.py", line 61, in create_clidriver
    load_plugins(session.full_config.get('plugins', {}),
  File "/usr/local/Cellar/awscli/1.11.37/libexec/lib/python2.7/site-packages/botocore/session.py", line 375, in full_config
    self._config = botocore.configloader.load_config(config_file)
  File "/usr/local/Cellar/awscli/1.11.37/libexec/lib/python2.7/site-packages/botocore/configloader.py", line 105, in load_config
    parsed = raw_config_parse(config_filename)
  File "/usr/local/Cellar/awscli/1.11.37/libexec/lib/python2.7/site-packages/botocore/configloader.py", line 145, in raw_config_parse
    raise botocore.exceptions.ConfigNotFound(path=path)
  File "/usr/local/Cellar/awscli/1.11.37/libexec/lib/python2.7/site-packages/botocore/exceptions.py", line 27, in __init__
    msg = self.fmt.format(**kwargs)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 5: ordinal not in range(128)
➜  ~ aws --debug
Traceback (most recent call last):
  File "/usr/local/bin/aws", line 27, in <module>
    sys.exit(main())
  File "/usr/local/bin/aws", line 23, in main
    return awscli.clidriver.main()
  File "/usr/local/Cellar/awscli/1.11.37/libexec/lib/python2.7/site-packages/awscli/clidriver.py", line 53, in main
    driver = create_clidriver()
  File "/usr/local/Cellar/awscli/1.11.37/libexec/lib/python2.7/site-packages/awscli/clidriver.py", line 61, in create_clidriver
    load_plugins(session.full_config.get('plugins', {}),
  File "/usr/local/Cellar/awscli/1.11.37/libexec/lib/python2.7/site-packages/botocore/session.py", line 375, in full_config
    self._config = botocore.configloader.load_config(config_file)
  File "/usr/local/Cellar/awscli/1.11.37/libexec/lib/python2.7/site-packages/botocore/configloader.py", line 105, in load_config
    parsed = raw_config_parse(config_filename)
  File "/usr/local/Cellar/awscli/1.11.37/libexec/lib/python2.7/site-packages/botocore/configloader.py", line 145, in raw_config_parse
    raise botocore.exceptions.ConfigNotFound(path=path)
  File "/usr/local/Cellar/awscli/1.11.37/libexec/lib/python2.7/site-packages/botocore/exceptions.py", line 27, in __init__
    msg = self.fmt.format(**kwargs)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 5: ordinal not in range(128)

@kyleknap
Copy link
Contributor

Right this error happens before the debug logger actually gets registered, so there won't be any debug logs... We will look into reproducing it and come up with a fix. Thanks for the complete Traceback!

@kyleknap
Copy link
Contributor

I can confirm the same on my OS X machine. We will look into what we can do here.

@soukicz
Copy link

soukicz commented Jan 26, 2017

It is probably the same issue as #2366

@galopin
Copy link

galopin commented Jan 31, 2017

@kyleknap Having the same issue on my Windows set-up:

$ echo $HOME
/c/Documents and Settings/Michaël

$ aws
Traceback (most recent call last):
  File "C:/Python27/Scripts/aws", line 27, in <module>
    sys.exit(main())
  File "C:/Python27/Scripts/aws", line 23, in main
    return awscli.clidriver.main()
  File "C:\Python27\lib\site-packages\awscli\clidriver.py", line 53, in main
    driver = create_clidriver()
  File "C:\Python27\lib\site-packages\awscli\clidriver.py", line 61, in create_clidriver
    load_plugins(session.full_config.get('plugins', {}),
  File "C:\Python27\lib\site-packages\botocore\session.py", line 375, in full_config
    self._config = botocore.configloader.load_config(config_file)
  File "C:\Python27\lib\site-packages\botocore\configloader.py", line 105, in load_config
    parsed = raw_config_parse(config_filename)
  File "C:\Python27\lib\site-packages\botocore\configloader.py", line 145, in raw_config_parse
    raise botocore.exceptions.ConfigNotFound(path=path)
  File "C:\Python27\lib\site-packages\botocore\exceptions.py", line 27, in __init__
    msg = self.fmt.format(**kwargs)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xeb in position 31: ordinal not in range(128)

Interestingly PyPa pip project had a similar issue (pypa/pip#3463) that was fixed in early October 2016 (pypa/pip#4000):

* Fix problems on Windows on Python 2 when username or hostname contains
  non-ASCII characters (:issue:`3463`, :pull:`3970`, :pull:`4000`).

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants