summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2013-10-17 12:35:35 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2013-10-17 12:35:35 (GMT)
commit7d270ee05d7553aea1052cf7957358888ac8ad85 (patch)
tree4b3252363aac65d60104ef68dbc2d5174c0d8a91 /Include
parent26f92680da305a4f3007c47e11cced893991ec70 (diff)
downloadcpython-7d270ee05d7553aea1052cf7957358888ac8ad85.zip
cpython-7d270ee05d7553aea1052cf7957358888ac8ad85.tar.gz
cpython-7d270ee05d7553aea1052cf7957358888ac8ad85.tar.bz2
Issue #16129: Add `Py_SetStandardStreamEncoding`
This new pre-initialization API allows embedding applications like Blender to force a particular encoding and error handler for the standard IO streams. Also refactors Modules/_testembed.c to let us start testing multiple embedding scenarios. (Initial patch by Bastien Montagne)
Diffstat (limited to 'Include')
-rw-r--r--Include/pythonrun.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Include/pythonrun.h b/Include/pythonrun.h
index 8fdb5b5..70c412b 100644
--- a/Include/pythonrun.h
+++ b/Include/pythonrun.h
@@ -38,6 +38,8 @@ PyAPI_FUNC(int) Py_IsInitialized(void);
PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void);
PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *);
+PyAPI_FUNC(int) Py_SetStandardStreamEncoding(const char *encoding, const char *errors);
+
#ifndef Py_LIMITED_API
PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);