diff options
author | Victor Stinner <vstinner@python.org> | 2023-09-03 16:54:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-03 16:54:27 (GMT) |
commit | 03c4080c71f49df9c219354b7b38b738917fd2ed (patch) | |
tree | 77e69accecd104ce8195741923605fa713a8bb5d /Misc | |
parent | 1796c191b43ed0787d83c07be7de8118fb10e8b0 (diff) | |
download | cpython-03c4080c71f49df9c219354b7b38b738917fd2ed.zip cpython-03c4080c71f49df9c219354b7b38b738917fd2ed.tar.gz cpython-03c4080c71f49df9c219354b7b38b738917fd2ed.tar.bz2 |
gh-108765: Python.h no longer includes <ctype.h> (#108831)
Remove <ctype.h> in C files which don't use it; only sre.c and
_decimal.c still use it.
Remove _PY_PORT_CTYPE_UTF8_ISSUE code from pyport.h:
* Code added by commit b5047fd01948ab108edcc1b3c2c901d915814cfd
in 2004 for MacOSX and FreeBSD.
* Test removed by commit 52ddaefb6bab1a74ecffe8519c02735794ebfbe1
in 2007, since Python str type now uses locale independent
functions like Py_ISALPHA() and Py_TOLOWER() and the Unicode
database.
Modules/_sre/sre.c replaces _PY_PORT_CTYPE_UTF8_ISSUE with new
functions: sre_isalnum(), sre_tolower(), sre_toupper().
Remove unused includes:
* _localemodule.c: remove <stdio.h>.
* getargs.c: remove <float.h>.
* dynload_win.c: remove <direct.h>, it no longer calls _getcwd()
since commit fb1f68ed7cc1536482d1debd70a53c5442135fe2 (in 2001).
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/C API/2023-09-02-22-35-55.gh-issue-108765.4TOdBT.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/C API/2023-09-02-22-35-55.gh-issue-108765.4TOdBT.rst b/Misc/NEWS.d/next/C API/2023-09-02-22-35-55.gh-issue-108765.4TOdBT.rst new file mode 100644 index 0000000..c13b6d9 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2023-09-02-22-35-55.gh-issue-108765.4TOdBT.rst @@ -0,0 +1,5 @@ +``Python.h`` no longer includes the ``<ctype.h>`` standard header file. If +needed, it should now be included explicitly. For example, it provides +``isalpha()`` and ``tolower()`` functions which are locale dependent. Python +provides locale independent functions, like :c:func:`!Py_ISALPHA` and +:c:func:`!Py_TOLOWER`. Patch by Victor Stinner. |