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 Drekin
Recipients Arfrever, Drekin, eric.snow, georg.brandl, larry, ncoghlan, serhiy.storchaka
Date 2015-08-04.12:20:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1438690807.88.0.130669510777.issue19518@psf.upfronthosting.co.za>
In-reply-to
Content
I'm not sure this is the right issue. The support for Unicode filenames is not (at least on Windows) ideal.

Let α.py be a Python script with invalid syntax.

> py α.py
  File "<encoding error>", line 2
    as as compile error
     ^
SyntaxError: invalid syntax

On the other hand, if run.py is does something like

path = sys.argv[1]
with tokenize.open(path) as f:
    source = f.read()
code = compile(source, path, "exec")
exec(code, __main__.__dict__)

we get 
> py run.py α.py
  File "Python Unicode\\u03b1.py", line 2
    as as compile error
     ^
SyntaxError: invalid syntax

(or 'File "Python Unicode\α.py", line 2' depending on whether sys.stdout can encode the string).

So the "<encoding error>" in the first example is unfortunate as it is easy to get better result even by a simple pure Python approach.
History
Date User Action Args
2015-08-04 12:20:08Drekinsetrecipients: + Drekin, georg.brandl, ncoghlan, larry, Arfrever, eric.snow, serhiy.storchaka
2015-08-04 12:20:07Drekinsetmessageid: <1438690807.88.0.130669510777.issue19518@psf.upfronthosting.co.za>
2015-08-04 12:20:07Drekinlinkissue19518 messages
2015-08-04 12:20:07Drekincreate