summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-11-23 12:08:26 (GMT)
committerGitHub <noreply@github.com>2018-11-23 12:08:26 (GMT)
commit353933e712b6c7f7ba9a9a50bd5bd472db7c35d0 (patch)
treeb91db22bcb76a9459a0495c96f21524368af401c /Include
parente89607c0fc8d6edbf19c06ba42ff0f00e6c4273f (diff)
downloadcpython-353933e712b6c7f7ba9a9a50bd5bd472db7c35d0.zip
cpython-353933e712b6c7f7ba9a9a50bd5bd472db7c35d0.tar.gz
cpython-353933e712b6c7f7ba9a9a50bd5bd472db7c35d0.tar.bz2
bpo-34523: Fix C locale coercion on FreeBSD CURRENT (GH-10672)
bpo-34523, bpo-35290: C locale coercion now resets the Python internal "force ASCII" mode. This change fix the filesystem encoding on FreeBSD CURRENT, which has a new "C.UTF-8" locale, when the UTF-8 mode is disabled. Add _Py_ResetForceASCII(): _Py_SetLocaleFromEnv() now calls it.
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_fileutils.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Include/internal/pycore_fileutils.h b/Include/internal/pycore_fileutils.h
index 98eb258..2500665 100644
--- a/Include/internal/pycore_fileutils.h
+++ b/Include/internal/pycore_fileutils.h
@@ -32,6 +32,14 @@ PyAPI_FUNC(wchar_t*) _Py_DecodeUTF8_surrogateescape(
PyAPI_FUNC(int) _Py_GetForceASCII(void);
+/* Reset "force ASCII" mode (if it was initialized).
+
+ This function should be called when Python changes the LC_CTYPE locale,
+ so the "force ASCII" mode can be detected again on the new locale
+ encoding. */
+PyAPI_FUNC(void) _Py_ResetForceASCII(void);
+
+
PyAPI_FUNC(int) _Py_GetLocaleconvNumeric(
struct lconv *lc,
PyObject **decimal_point,