STINNER Victor <[email protected]> added the comment:
I confirm: Python 3.10 works as expected.
Python 3.10 fails with the same SyntaxError using "python script.py" or "python
-m script" if the script contains non-ASCII characters but is not encoded to
UTF-8.
vstinner@apu$ python3 test.py
File "/home/vstinner/test.py", line 1
print('�Hello world!')
^
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xa1 in position
0: invalid start byte
vstinner@apu$ python3 -m test
Traceback (most recent call last):
(...)
File "/home/vstinner/test.py", line 1
print('�Hello world!')
^
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xa1 in position
0: invalid start byte
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue19941>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com