This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients ezio.melotti
Date 2009-02-20.05:17:11
SpamBayes Score 1.9196339e-10
Marked as misclassified No
Message-id <1235107034.92.0.375060629759.issue5325@psf.upfronthosting.co.za>
In-reply-to
Content
Step to reproduce:
1) create a directory with non-ascii chars in the name
2) create a python module with a syntax error (I used an unclosed '(')
3) execute the module.py directly ('module.py', not 'python module.py')

I tested this only on Windows, with Python3 as the default interpreter
used to execute *.py files, this is the output:

# ascii dir, works fine
D:\>module1.py
  File "D:\module1.py", line 21
                       ^
SyntaxError: invalid syntax
# moving to non-ascii dir
D:\>cd äåæ
# non ascii-dir, fails
D:\äåæ>module1.py
SyntaxError: None
# here is using py2.6, but with 'python module1.py' it doesn't print the
dir name
D:\äåæ>python module1.py
  File "module1.py", line 21
                       ^
SyntaxError: invalid syntax
# same as before but with py3
D:\äåæ>python3 module1.py
  File "module1.py", line 21
                       ^
SyntaxError: invalid syntax

# with print(sys.version) in module1.py
D:\äåæ>module1.py
3.0 (r30:67507, Dec  3 2008, 20:14:27) [MSC v.1500 32 bit (Intel)]
D:\äåæ>python module1.py
2.6 (r26:66721, Oct  2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)]
D:\äåæ>python3 module1.py
3.0 (r30:67507, Dec  3 2008, 20:14:27) [MSC v.1500 32 bit (Intel)]

This seems to happen only with SyntaxErrors, I tested a couple of other
errors and it seems to work:

# with print(sys.version) and 5/0 in module1
# here it prints the dir name without problems (but it doesn't show '5/0')
D:\äåæ>module1.py
3.0 (r30:67507, Dec  3 2008, 20:14:27) [MSC v.1500 32 bit (Intel)]
Traceback (most recent call last):
  File "D:\äåæ\module1.py", line 3, in <module>
ZeroDivisionError: int division or modulo by zero

D:\äåæ>python module1.py
2.6 (r26:66721, Oct  2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)]
Traceback (most recent call last):
  File "module1.py", line 3, in <module>
    5/0
ZeroDivisionError: integer division or modulo by zero

D:\äåæ>python3 module1.py
3.0 (r30:67507, Dec  3 2008, 20:14:27) [MSC v.1500 32 bit (Intel)]
Traceback (most recent call last):
  File "module1.py", line 3, in <module>
    5/0
ZeroDivisionError: int division or modulo by zero
History
Date User Action Args
2009-02-20 05:17:14ezio.melottisetrecipients: + ezio.melotti
2009-02-20 05:17:14ezio.melottisetmessageid: <1235107034.92.0.375060629759.issue5325@psf.upfronthosting.co.za>
2009-02-20 05:17:12ezio.melottilinkissue5325 messages
2009-02-20 05:17:11ezio.melotticreate