bpo-36142: Add _PyPreConfig.utf8_mode (GH-12174) · python/cpython@5a02e0d · GitHub
Skip to content

Commit 5a02e0d

Browse files
authored
bpo-36142: Add _PyPreConfig.utf8_mode (GH-12174)
* Move following fields from _PyCoreConfig to _PyPreConfig: * coerce_c_locale * coerce_c_locale_warn * legacy_windows_stdio * utf8_mode * _PyPreConfig_ReadFromArgv() is now responsible to choose the filesystem encoding * _PyPreConfig_Write() now sets the LC_CTYPE locale
1 parent 5b10b98 commit 5a02e0d

7 files changed

Lines changed: 465 additions & 366 deletions

File tree

Include/cpython/coreconfig.h

Lines changed: 32 additions & 22 deletions

Include/internal/pycore_coreconfig.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,24 @@ PyAPI_FUNC(int) _Py_SetArgcArgv(int argc, wchar_t * const *argv);
3636

3737
/* --- _PyPreConfig ----------------------------------------------- */
3838

39+
PyAPI_FUNC(int) _Py_str_to_int(
40+
const char *str,
41+
int *result);
42+
PyAPI_FUNC(const wchar_t*) _Py_get_xoption(
43+
int nxoption,
44+
wchar_t * const *xoptions,
45+
const wchar_t *name);
46+
3947
PyAPI_FUNC(void) _PyPreConfig_Clear(_PyPreConfig *config);
4048
PyAPI_FUNC(int) _PyPreConfig_Copy(_PyPreConfig *config,
4149
const _PyPreConfig *config2);
4250
PyAPI_FUNC(void) _PyPreConfig_GetGlobalConfig(_PyPreConfig *config);
4351
PyAPI_FUNC(void) _PyPreConfig_SetGlobalConfig(const _PyPreConfig *config);
52+
PyAPI_FUNC(const char*) _PyPreConfig_GetEnv(const _PyPreConfig *config,
53+
const char *name);
54+
PyAPI_FUNC(void) _Py_get_env_flag(_PyPreConfig *config,
55+
int *flag,
56+
const char *name);
4457
PyAPI_FUNC(_PyInitError) _PyPreConfig_Read(_PyPreConfig *config);
4558
PyAPI_FUNC(int) _PyPreConfig_AsDict(const _PyPreConfig *config,
4659
PyObject *dict);

Programs/_testembed.c

Lines changed: 3 additions & 3 deletions

0 commit comments

Comments
 (0)