Closed
Description
Feature or enhancement
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Proposal:
The following C files use <ctype.h> functions which depend on the current LC_CTYPE locale:
$ git grep -l -E '\b(isalnum|isalpha|iscntrl|isdigit|islower|isgraph|isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper)\b'|grep -E '\.c$'
Modules/_decimal/libmpdec/io.c
Modules/_sre/sre.c
Modules/_zoneinfo.c
Modules/getaddrinfo.c
Objects/bytearrayobject.c
Objects/bytes_methods.c
Objects/bytesobject.c
Objects/unicodeobject.c
PC/launcher.c
PC/launcher2.c
Parser/tokenizer.c
Python/formatter_unicode.c
Python/pystrcmp.c
I propose to replace them with Python C API functions which don't depend on the locale, like Py_ISDIGIT() and Py_TOLOWER().