Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

SyntaxError: Non-ASCII character #5

Closed
Amit-A opened this issue Aug 10, 2019 · 4 comments
Closed

SyntaxError: Non-ASCII character #5

Amit-A opened this issue Aug 10, 2019 · 4 comments

Comments

@Amit-A
Copy link

Amit-A commented Aug 10, 2019

I'm getting this error:

Traceback (most recent call last):
  File "/home/travis/.local/bin/travis-wait-improved", line 6, in <module>
    from travis_wait_improved.sherpa import main
  File "/home/travis/.local/lib/python2.7/site-packages/travis_wait_improved/sherpa.py", line 29
SyntaxError: Non-ASCII character '\xe2' in file /home/travis/.local/lib/python2.7/site-packages/travis_wait_improved/sherpa.py on line 29, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

.travis.yml:

  ...
  before_deploy:
    - pip install travis-wait-improved --user
    deploy:
      skip_cleanup: true
      provider: script
      script: travis-wait-improved --timeout 30m bash scripts/travis_deploy.sh
      on:
        all_branches: true
  ...

When I tried without --user:

Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/docopt.py'
Consider using the `--user` option or check the permissions.
@Amit-A
Copy link
Author

Amit-A commented Aug 10, 2019

Cause is probably character:

# line 29 in sherpa.py
HEADER = colored("Travis-wait ❱", "magenta", attrs=["bold"])

Amit-A added a commit to Amit-A/travis-wait-improved that referenced this issue Aug 10, 2019
@mcdonnnj
Copy link
Member

@Amit-A Thank you for taking the time to contribute. I see that your environment appears to be using Python 2.7, but this tool was written for Python 3.6+. Even if the special character was replaced you would run into issues with the f-strings used later on in the tool.

@mcdonnnj
Copy link
Member

Feel free to reopen this issue if you believe it is still a relevant change given the context I added.

@samos123
Copy link

samos123 commented Jan 9, 2020

the readme should point out that this tool only works on python3. I hit the exact same issue today.

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

No branches or pull requests

3 participants