bpo-20844: open script file with "rb" mode (GH-12616)

This commit is contained in:
Inada Naoki 2019-04-01 18:35:20 +09:00 committed by GitHub
parent 62f9588663
commit 10654c19b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 1 deletions

View file

@ -109,6 +109,10 @@ the same library that the Python runtime is using.
(:func:`sys.getfilesystemencoding`). If *closeit* is true, the file is
closed before PyRun_SimpleFileExFlags returns.
.. note::
On Windows, *fp* should be opened as binary mode (e.g. ``fopen(filename, "rb")``.
Otherwise, Python may not handle script file with LF line ending correctly.
.. c:function:: int PyRun_InteractiveOne(FILE *fp, const char *filename)