summaryrefslogtreecommitdiff
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-11-23 13:37:42 +0100
committerGitHub <noreply@github.com>2018-11-23 13:37:42 +0100
commitf6e323ce322cf54b1a9e9252b13f93ebc28b5c24 (patch)
tree929a617da14329ea9edd784256f7d77f75955d0e /Include
parent95036ea25d47f0081bda2ba96ea327f3375cb6a4 (diff)
downloadcpython-git-f6e323ce322cf54b1a9e9252b13f93ebc28b5c24.tar.gz
bpo-34523: Fix C locale coercion on FreeBSD CURRENT (GH-10672) (GH-10673)
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. (cherry picked from commit 353933e712b6c7f7ba9a9a50bd5bd472db7c35d0)
Diffstat (limited to 'Include')
-rw-r--r--Include/fileutils.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Include/fileutils.h b/Include/fileutils.h
index d75189a95c..419d49ab75 100644
--- a/Include/fileutils.h
+++ b/Include/fileutils.h
@@ -185,6 +185,13 @@ PyAPI_FUNC(int) _Py_GetLocaleconvNumeric(
#ifdef Py_BUILD_CORE
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);
#endif
#ifdef __cplusplus