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

Python2 npm3 install fails on unicode output #111

Open
mrlannigan opened this issue Oct 26, 2016 · 1 comment
Open

Python2 npm3 install fails on unicode output #111

mrlannigan opened this issue Oct 26, 2016 · 1 comment

Comments

@mrlannigan
Copy link

kennethreitz/clint#153

I found a fix for the problem I am experiencing and so did someone else, awhile ago. Seems that if I use the --debug flag with the execution of a build command in a node.js lambda. The install will run then exit with the following truncated error message:

  File "/usr/local/lib/python2.7/site-packages/gordon/resources/lambdas.py", line 538, in _collect_lambda_module_content
    self.project.puts(out.decode("utf-8"))
  File "/usr/local/lib/python2.7/site-packages/gordon/core.py", line 129, in puts
    puts(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/clint/textui/core.py", line 58, in puts
    s = map(str, s)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)

I later discovered after some digging that it was complaining about displaying a (✓) \u2713. This likely has something to do with the progress bar that npm displays and the fact that in python2 the str encode doesn't gracefully handle unicode characters. Disclaimer: I'm relatively new to python so please do correct me if I'm wrong.

My versions:

$ python --version
Python 2.7.12
$ node -v
v4.6.1
$ npm -v
3.10.9

I'm merely posting this for posterity.

Update:
The clint PR has been merged.

@lukemelia
Copy link
Contributor

I also experienced this. --debug is usually what you pass when troubleshooting something, so it's confusing to have it generate its own problems.

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

No branches or pull requests

2 participants