[issue32381] python3.6 can not reopen .pyc file with Chinese path

2017-12-19 Thread tianjg

New submission from tianjg :

have a problem that python3.6 can not reopen .pyc file with Chinese path, and 
python3.5 can reopen the same pyc file. As shown in the picture

--
components: Windows
files: 20171218111240.jpg
messages: 308705
nosy: paul.moore, steve.dower, tianjg, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: python3.6 can not reopen .pyc file with Chinese path
type: compile error
versions: Python 3.6
Added file: https://bugs.python.org/file47341/20171218111240.jpg

___
Python tracker 
<https://bugs.python.org/issue32381>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32381] Python 3.6 cannot reopen .pyc file with non-ASCII path

2017-12-20 Thread Tianjg

Tianjg  added the comment:

Thanks a lot. What should I do to  reopen .pyc file with non-ASCII path use
python3.6 in cmd?Could you give me* some **code examples*.Thank you again,
and I look forward to hearing from you

2017-12-20 15:35 GMT+08:00 Eryk Sun :

>
> Eryk Sun  added the comment:
>
> run_file encodes the file path via PyUnicode_EncodeFSDefault, which
> encodes as UTF-8 in Windows, starting with 3.6. PyRun_SimpleFileExFlags
> subsequently tries to open this encoded path via _Py_fopen, which calls
> fopen. The CRT expects an ANSI encoded path, so only the common ASCII
> subset will work. Non-ASCII paths will fail.
>
> This could be addressed in _Py_fopen by decoding the path and calling
> _wfopen instead of fopen.
>
> Executing a .pyc also fails in 3.5 if the wide-character path can't be
> encoded as ANSI, but the 3.5 branch only accepts security fixes.
>
> --
> components: +Interpreter Core, Unicode
> nosy: +eryksun, ezio.melotti, vstinner
> stage:  -> test needed
> title: python3.6 can not reopen .pyc file with Chinese path -> Python 3.6
> cannot reopen .pyc file with non-ASCII path
> type: compile error -> behavior
> versions: +Python 3.7
>
> ___
> Python tracker 
> <https://bugs.python.org/issue32381>
> ___
>

--
nosy: +Tianjg

___
Python tracker 
<https://bugs.python.org/issue32381>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com