summaryrefslogtreecommitdiffstats
path: root/Python/fileutils.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-08-28 12:53:31 (GMT)
committerGitHub <noreply@github.com>2018-08-28 12:53:31 (GMT)
commit4ff38870b1de8a3add5357edf125c2866bc42b54 (patch)
tree40dfeda13262fc21fb5ef97029564a5c084b8553 /Python/fileutils.c
parent204fb459ca1d77c2eab02a3191ba2d2216ff2d72 (diff)
downloadcpython-4ff38870b1de8a3add5357edf125c2866bc42b54.zip
cpython-4ff38870b1de8a3add5357edf125c2866bc42b54.tar.gz
cpython-4ff38870b1de8a3add5357edf125c2866bc42b54.tar.bz2
bpo-34527: Fix FreeBSD with POSIX locale (GH-8975)
On FreeBSD, Py_DecodeLocale() and Py_EncodeLocale() now also forces the ASCII encoding if the LC_CTYPE locale is "POSIX", not only if the LC_CTYPE locale is "C".
Diffstat (limited to 'Python/fileutils.c')
-rw-r--r--Python/fileutils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/fileutils.c b/Python/fileutils.c
index b9638d2..b8e4891 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -132,7 +132,7 @@ check_force_ascii(void)
loc = setlocale(LC_CTYPE, NULL);
if (loc == NULL)
goto error;
- if (strcmp(loc, "C") != 0) {
+ if (strcmp(loc, "C") != 0 && strcmp(loc, "POSIX") != 0) {
/* the LC_CTYPE locale is different than C */
return 0;
}