diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2013-10-18 13:11:47 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2013-10-18 13:11:47 (GMT) |
commit | 1805a62f1fe551b73b80d87a429ef496c1701b07 (patch) | |
tree | 3925c6426a13a6c46550befcc2c1f7ba253493f5 /Doc/c-api | |
parent | ac1a2489681d16ecc92985aefbd944e3b70fd26f (diff) | |
download | cpython-1805a62f1fe551b73b80d87a429ef496c1701b07.zip cpython-1805a62f1fe551b73b80d87a429ef496c1701b07.tar.gz cpython-1805a62f1fe551b73b80d87a429ef496c1701b07.tar.bz2 |
Issue #16129: Py_SetStandardStreamEncoding cleanups
- don't call PyErr_NoMemory with interpreter is not initialised
- note that it's OK to call _PyMem_RawStrDup here
- don't include this in the limited API
- capitalise "IO"
- be explicit that a non-zero return indicates an error
- include versionadded marker in docs
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/init.rst | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index 1a54321..6439d7f 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -93,12 +93,12 @@ Process-wide parameters single: main() triple: stdin; stdout; sdterr - This function should be called before :c:func:`Py_Initialize`. It - specifies which encoding and error handling to use with standard io, - with the same meanings as in :func:`str.encode`. + This function should be called before :c:func:`Py_Initialize`, if it is + called at all. It specifies which encoding and error handling to use + with standard IO, with the same meanings as in :func:`str.encode`. It overrides :envvar:`PYTHONIOENCODING` values, and allows embedding code - to control io encoding when the environment variable does not work. + to control IO encoding when the environment variable does not work. ``encoding`` and/or ``errors`` may be NULL to use :envvar:`PYTHONIOENCODING` and/or default values (depending on other @@ -110,7 +110,10 @@ Process-wide parameters If :c:func:`Py_Finalize` is called, this function will need to be called again in order to affect subsequent calls to :c:func:`Py_Initialize`. - Returns 0 if successful. + Returns 0 if successful, a nonzero value on error (e.g. calling after the + interpreter has already been initialized). + + .. versionadded:: 3.4 .. c:function:: void Py_SetProgramName(wchar_t *name) |