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

SyntaxError: Non-ASCII character '\xc3' in file /var/local/git/grpc/py27_gevent/local/lib/python2.7/site-packages/rsa/key.py #23190

Closed
stanley-cheung opened this issue Jun 12, 2020 · 8 comments · Fixed by #23197
Assignees
Labels
disposition/BUILDNURSE For all buildnurse related build/test failures and flakes kind/bug lang/Python priority/P2

Comments

@stanley-cheung
Copy link
Contributor

stanley-cheung commented Jun 12, 2020

Things seem to start breaking around 10:54am Jun 11 according to this dashboard:

https://fusion.corp.google.com/projectanalysis/summary/KOKORO/prod:grpc%2Fcore%2Fpull_request%2Flinux%2Fgrpc_basictests_python

All the Python tests are failing with this error

SyntaxError: Non-ASCII character '\xc3' in file /var/local/git/grpc/py27_gevent/local/lib/python2.7/site-packages/rsa/key.py on line 1, but no
encoding declared; see http://python.org/dev/peps/pep-0263/ for details

Maybe something to do with a new release here: https://pypi.org/project/rsa/#history and sybrenstuvel/python-rsa#152. A similar fix: googleapis/google-auth-library-python#528.

@stanley-cheung stanley-cheung added the disposition/BUILDNURSE For all buildnurse related build/test failures and flakes label Jun 12, 2020
@stanley-cheung stanley-cheung assigned lidizheng and unassigned veblush Jun 12, 2020
@victory-jooyon
Copy link

victory-jooyon commented Jun 12, 2020

I am having the same issue happening from today,

SyntaxError: Non-ASCII character '\xc3' in file /otlplus/venv/lib/python2.7/site-packages/rsa/key.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

@ttwd80
Copy link

ttwd80 commented Jun 12, 2020

I have the same error. I think the name Sybren A. Stüvel is the issue. But looking at git blame, it was modified 9 years ago. Not sure why we are seeing this error now. It was okay for me with rsa 4.0 but not rsa 4.2.
https://github.com/sybrenstuvel/python-rsa/blame/master/rsa/key.py

@hashikami
Copy link

hashikami commented Jun 12, 2020

@ttwd80 me too. I could solve with rsa 4.0. In rsa 4.2, python 3 style is used, ex., 54 line : def __init__(self, n: int, e: int) -> None: (https://github.com/sybrenstuvel/python-rsa/blob/master/rsa/key.py#L54).

@Storyyeller
Copy link

Could this be the change that broke everything? https://github.com/sybrenstuvel/python-rsa/commits/master/rsa/key.py

@sybrenstuvel
Copy link

I fixed it in the Python-RSA package so that package managers now know which version they can use. Python-RSA 4.3 is now the last one to support Python 2.7, version 4.4 explicitly requires Python 3.5+.

Hope this is now resolved for you, if there are still issues let me know.

@John-Oula
Copy link

Has anybody solved this yet?
def init(self, n: int, e: int) -> None: Syntax error

Im on python3.7

@n3yron
Copy link

n3yron commented Aug 10, 2021

I have Python 2.7. Fixed via:
pip uninstall rsa
pip install -v rsa==4.0
As the last version with Python 2.7 support was Python-RSA 4.0.
https://stuvel.eu/python-rsa-doc/installation.html

@chris-gillatt
Copy link

pip uninstall -y rsa to avoid the prompt if you're automating this in a Dockerfile etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition/BUILDNURSE For all buildnurse related build/test failures and flakes kind/bug lang/Python priority/P2
Projects
None yet
Development

Successfully merging a pull request may close this issue.