[issue19941] python -m imports non-ASCII .py file without encoding declaration

2021-11-30 Thread STINNER Victor
STINNER Victor 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

[issue19941] python -m imports non-ASCII .py file without encoding declaration

2021-11-30 Thread Eryk Sun
Eryk Sun added the comment: test.py is a UTF-8 file, which is the default source encoding in Python 3. It fails as expected if the test script is encoded differently, such as Latin-1, unless the source encoding is declared. -- nosy: +eryksun resolution: -> out of date stage: ->

[issue19941] python -m imports non-ASCII .py file without encoding declaration

2021-11-30 Thread Irit Katriel
Change by Irit Katriel : -- components: +Interpreter Core ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19941] python -m imports non-ASCII .py file without encoding declaration

2021-11-30 Thread Irit Katriel
Irit Katriel added the comment: On 3.11 both are working (on a Mac): cpython-1 % python -m tt ¡Hello world! cpython-1 % ./python.exe -c 'import tt' ¡Hello world! -- nosy: +iritkatriel ___ Python tracker

[issue19941] python -m imports non-ASCII .py file without encoding declaration

2020-03-06 Thread Brett Cannon
Change by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19941] python -m imports non-ASCII .py file without encoding declaration

2013-12-10 Thread Jakub Wilk
New submission from Jakub Wilk: If you have a non-ASCII .py file without encoding declaration, then you can't normally import it: $ python --version Python 2.7.6 $ python -c 'import test' Traceback (most recent call last): File string, line 1, in module File test.py, line 1 SyntaxError:

[issue19941] python -m imports non-ASCII .py file without encoding declaration

2013-12-10 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +brett.cannon, haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19941 ___ ___

[issue19941] python -m imports non-ASCII .py file without encoding declaration

2013-12-10 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +loewis, serhiy.storchaka type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19941 ___

[issue19941] python -m imports non-ASCII .py file without encoding declaration

2013-12-10 Thread R. David Murray
R. David Murray added the comment: Well, we aren't going to change 2.7 to have this case start throwing an error, since someone may be depending on it. So I'm not sure there's anything to do here. -- nosy: +ncoghlan, r.david.murray ___ Python

[issue19941] python -m imports non-ASCII .py file without encoding declaration

2013-12-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are several bugs in processing encoding declaration (issue18961, issue18873) and yet several were fixed last time. Perhaps this issue or issue19942 relate to them. -- ___ Python tracker

[issue19941] python -m imports non-ASCII .py file without encoding declaration

2013-12-10 Thread Nick Coghlan
Nick Coghlan added the comment: Quite plausibly a bug in the pkgutil import system emulation. Does the same inconsistency appear in 3.3 with non-UTF8 bytes? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19941

[issue19941] python -m imports non-ASCII .py file without encoding declaration

2013-12-10 Thread Benjamin Peterson
Benjamin Peterson added the comment: 3.x is afflicted. -- nosy: +benjamin.peterson versions: +Python 3.3, Python 3.4 -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19941 ___