@@ -66,8 +66,9 @@ the same library that the Python runtime is using.
6666 If *fp * refers to a file associated with an interactive device (console or
6767 terminal input or Unix pseudo-terminal), return the value of
6868 :c:func:`PyRun_InteractiveLoop`, otherwise return the result of
69- :c:func:`PyRun_SimpleFile`. If *filename* is *NULL*, this function uses
70- ``"???"`` as the filename.
69+ :c:func:`PyRun_SimpleFile`. *filename* is decoded from the filesystem
70+ encoding (:func: `sys.getfilesystemencoding `). If *filename* is *NULL*, this
71+ function uses ``"???"`` as the filename.
7172
7273
7374.. c:function:: int PyRun_SimpleString(const char *command)
@@ -110,9 +111,10 @@ the same library that the Python runtime is using.
110111.. c :function :: int PyRun_SimpleFileExFlags (FILE *fp, const char *filename, int closeit, PyCompilerFlags *flags)
111112
112113 Similar to :c:func: `PyRun_SimpleStringFlags `, but the Python source code is read
113- from *fp * instead of an in-memory string. *filename * should be the name of the
114- file. If *closeit * is true, the file is closed before PyRun_SimpleFileExFlags
115- returns.
114+ from *fp * instead of an in-memory string. *filename * should be the name of
115+ the file, it is decoded from the filesystem encoding
116+ (:func: `sys.getfilesystemencoding `). If *closeit* is true, the file is
117+ closed before PyRun_SimpleFileExFlags returns.
116118
117119
118120.. c:function:: int PyRun_InteractiveOne(FILE *fp, const char *filename)
@@ -125,7 +127,10 @@ the same library that the Python runtime is using.
125127
126128 Read and execute a single statement from a file associated with an
127129 interactive device according to the *flags * argument. The user will be
128- prompted using ``sys.ps1 `` and ``sys.ps2 ``. Returns ``0 `` when the input was
130+ prompted using ``sys.ps1 `` and ``sys.ps2 ``. *filename * is decoded from the
131+ filesystem encoding (:func: `sys.getfilesystemencoding `).
132+
133+ Returns ``0`` when the input was
129134 executed successfully, ``-1`` if there was an exception, or an error code
130135 from the :file:`errcode.h` include file distributed as part of Python if
131136 there was a parse error. (Note that :file: `errcode.h ` is not included by
@@ -142,7 +147,8 @@ the same library that the Python runtime is using.
142147
143148 Read and execute statements from a file associated with an interactive device
144149 until EOF is reached. The user will be prompted using ``sys.ps1 `` and
145- ``sys.ps2 ``. Returns ``0 `` at EOF.
150+ ``sys.ps2 ``. *filename * is decoded from the filesystem encoding
151+ (:func: `sys.getfilesystemencoding `). Returns ``0`` at EOF.
146152
147153
148154.. c:function:: struct _node* PyParser_SimpleParseString(const char *str, int start)
@@ -164,7 +170,8 @@ the same library that the Python runtime is using.
164170 Parse Python source code from *str * using the start token *start * according to
165171 the *flags * argument. The result can be used to create a code object which can
166172 be evaluated efficiently. This is useful if a code fragment must be evaluated
167- many times.
173+ many times. *filename * is decoded from the filesystem encoding
174+ (:func: `sys.getfilesystemencoding `).
168175
169176
170177.. c:function:: struct _node* PyParser_SimpleParseFile(FILE *fp, const char *filename, int start)
@@ -217,7 +224,8 @@ the same library that the Python runtime is using.
217224.. c :function :: PyObject* PyRun_FileExFlags (FILE *fp, const char *filename, int start, PyObject *globals, PyObject *locals, int closeit, PyCompilerFlags *flags)
218225
219226 Similar to :c:func: `PyRun_StringFlags `, but the Python source code is read from
220- *fp * instead of an in-memory string. *filename * should be the name of the file.
227+ *fp * instead of an in-memory string. *filename * should be the name of the file,
228+ it is decoded from the filesystem encoding (:func: `sys.getfilesystemencoding `).
221229 If *closeit* is true, the file is closed before :c:func:`PyRun_FileExFlags`
222230 returns.
223231
@@ -241,8 +249,9 @@ the same library that the Python runtime is using.
241249 code which can be compiled and should be :const: `Py_eval_input `,
242250 :const: `Py_file_input `, or :const: `Py_single_input `. The filename specified by
243251 *filename * is used to construct the code object and may appear in tracebacks or
244- :exc: `SyntaxError ` exception messages. This returns *NULL * if the code cannot
245- be parsed or compiled.
252+ :exc: `SyntaxError ` exception messages, it is decoded from the filesystem
253+ encoding (:func: `sys.getfilesystemencoding `). This returns *NULL* if the
254+ code cannot be parsed or compiled.
246255
247256 The integer *optimize* specifies the optimization level of the compiler; a
248257 value of ``-1 `` selects the optimization level of the interpreter as given by
0 commit comments