summaryrefslogtreecommitdiff
path: root/Ports/python3/patches/remove-setlocale-from-preconfig.patch
blob: f3824c556f5dc0e2d2cc5a847ddd2e80d3c7143b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- Python-3.9.1/Python/preconfig.c	2021-01-17 21:03:08.698000000 +0100
+++ Python-3.9.1/Python/preconfig.c	2021-01-17 21:03:47.828031544 +0100
@@ -790,16 +790,6 @@
 
     preconfig_get_global_vars(config);
 
-    /* Copy LC_CTYPE locale, since it's modified later */
-    const char *loc = setlocale(LC_CTYPE, NULL);
-    if (loc == NULL) {
-        return _PyStatus_ERR("failed to LC_CTYPE locale");
-    }
-    char *init_ctype_locale = _PyMem_RawStrdup(loc);
-    if (init_ctype_locale == NULL) {
-        return _PyStatus_NO_MEMORY();
-    }
-
     /* Save the config to be able to restore it if encodings change */
     PyPreConfig save_config;
 
@@ -899,10 +889,6 @@
     status = _PyStatus_OK();
 
 done:
-    if (init_ctype_locale != NULL) {
-        setlocale(LC_CTYPE, init_ctype_locale);
-        PyMem_RawFree(init_ctype_locale);
-    }
     Py_UTF8Mode = init_utf8_mode ;
 #ifdef MS_WINDOWS
     Py_LegacyWindowsFSEncodingFlag = init_legacy_encoding;