cpython/Modules
Bénédikt Tran 6ac578cf53
[3.12] gh-126554: ctypes: Correctly handle NULL dlsym values (GH-126555) (GH-127764)
For dlsym(), a return value of NULL does not necessarily indicate
an error [1].

Therefore, to avoid using stale (or NULL) dlerror() values, we must:

 1. clear the previous error state by calling dlerror()
 2. call dlsym()
 3. call dlerror()

If the return value of dlerror() is not NULL, an error occured.

In ctypes we choose to treat a NULL return value from dlsym()
as a "not found" error. This is the same as the fallback
message we use on Windows, Cygwin or when getting/formatting
the error reason fails.

[1]: https://man7.org/linux/man-pages/man3/dlsym.3.html

Signed-off-by: Georgios Alexopoulos <grgalex42@gmail.com>
Signed-off-by: Georgios Alexopoulos <grgalex@ba.uoa.gr>
Co-authored-by: George Alexopoulos <giorgosalexo0@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-12-17 13:53:43 +02:00
..
_blake2 gh-116116: Backport blake2 change to fix building with clang-cl on windows-i686 (GH-116117) 2024-03-04 17:22:46 +00:00
_ctypes [3.12] gh-126554: ctypes: Correctly handle NULL dlsym values (GH-126555) (GH-127764) 2024-12-17 13:53:43 +02:00
_decimal [3.12] gh-114563: C decimal falls back to pydecimal for unsupported format strings (GH-114879) (GH-115353) 2024-02-12 23:31:12 +02:00
_hacl [3.12] gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237) (GH-117243) 2024-03-26 01:43:24 +00:00
_io [3.12] gh-124008: Fix calculation of the number of written bytes for the Windows console (GH-124059) (GH-127326) 2024-11-27 16:00:30 +02:00
_multiprocessing [3.12] gh-115886: Handle embedded null characters in shared memory name (GH-115887) (GH-115906) 2024-02-25 11:09:28 +00:00
_sqlite [3.12] gh-113993: Make interned strings mortal (GH-120520, GH-121364, GH-121903, GH-122303) (#123065) 2024-09-27 13:28:48 -07:00
_sre [3.12] gh-101955: Fix SystemError in possesive quantifier with alternative and group (GH-111362) (GH-126963) 2024-11-18 12:03:19 +00:00
_ssl GH-103092: isolate _ssl (#104725) 2023-05-22 06:14:48 +05:30
_testcapi [3.12] gh-111495: Add tests for PyNumber C API (GH-111996) (#123376) 2024-09-06 00:51:26 +02:00
_xxtestfuzz [3.12] gh-121023: Improve _xxtestfuzz/README.rst (GH-121024) (#124141) 2024-09-16 20:29:02 +00:00
cjkcodecs [3.12] gh-115015: Argument Clinic: fix generated code for METH_METHOD methods without params (#115016) (#115067) 2024-02-06 11:20:16 +01:00
clinic [3.12] gh-124917: Allow keyword args to os.path.exists/lexists on Windows (GH-124918) (#125334) 2024-10-11 15:18:46 -07:00
expat [3.12] gh-126623: Update libexpat to 2.6.4, make future updates easier (GH-126792) (GH-126797) 2024-11-13 18:50:29 +00:00
_abc.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_asynciomodule.c [3.12] gh-126405: fix use-after-free in _asyncio.Future.remove_done_callback (GH-126733) (#126737) 2024-11-12 13:04:25 +00:00
_bisectmodule.c [3.12] gh-126035: add missing whitespace to *Py_EnterRecursiveCall() messages (GH-126036) (#126059) 2024-10-27 22:12:20 +00:00
_bz2module.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_codecsmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_collectionsmodule.c [3.12] gh-115243: Fix crash in deque.index() when the deque is concurrently modified (GH-115247) (GH-115465) 2024-02-14 17:17:58 +00:00
_contextvarsmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_cryptmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_csv.c [3.12] gh-113785: csv: fields starting with escapechar are not quoted (GH-122110) (GH-122259) 2024-08-09 16:04:29 +00:00
_curses_panel.c [3.12] gh-86493: Fix possible leaks in modules initialization: _curses_panel, _decimal, posix, xxsubtype (GH-106767) (#106849) 2023-07-18 10:03:59 +03:00
_cursesmodule.c [3.12] gh-120378: Fix crash caused by integer overflow in curses (GH-124555) (#124911) 2024-10-02 21:40:49 +00:00
_datetimemodule.c [3.12] gh-52551: Fix encoding issues in strftime() (GH-125193) (GH-125657) (GH-125661) 2024-10-17 20:04:48 +00:00
_dbmmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_elementtree.c [3.12] gh-123213: Fixed xml.etree.ElementTree.Element.extend and assignment to no longer hide exceptions (GH-123214) (#123258) 2024-09-06 11:51:18 +03:00
_functoolsmodule.c [3.12] Align functools.reduce() docstring with PEP-257 (GH-126045) (#126114) 2024-10-29 10:13:52 +01:00
_gdbmmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_hashopenssl.c [3.12] gh-117233: Detect support for several hashes at hashlib build time (GH-117234) (#117767) 2024-04-11 18:36:31 +00:00
_heapqmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_json.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_localemodule.c [3.12] gh-126727: Fix locale.nl_langinfo(locale.ERA) (GH-126730) (GH-127098) 2024-11-21 11:44:37 +00:00
_lsprof.c [3.12] gh-126425: Refactor _lsprof_Profiler_enable (GH-126426) (#126443) 2024-11-05 12:42:33 +00:00
_lzmamodule.c [3.12] gh-104282: Fix null pointer dereference in lzma._decode_filter_properties (GH-104283) (GH-114181) 2024-01-17 13:31:33 +00:00
_math.h gh-101678: refactor the math module to use special functions from c11 (GH-101679) 2023-02-09 00:40:52 -08:00
_opcode.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_operator.c [3.12] gh-113993: Make interned strings mortal (GH-120520, GH-121364, GH-121903, GH-122303) (#123065) 2024-09-27 13:28:48 -07:00
_pickle.c [3.12] gh-126991: Fix reference leak in loading pickle's opcode BUILD (GH-126990) (GH-127019) 2024-11-19 20:19:18 +02:00
_posixsubprocess.c [3.12] gh-113964: Don't prevent new threads until all non-daemon threads exit (GH-116677) (#117029) 2024-03-19 15:22:42 -04:00
_queuemodule.c [3.12] gh-104812: Run Pending Calls in any Thread (gh-104813) (gh-105752) 2023-06-14 00:50:08 +00:00
_randommodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_scproxy.c gh-104180: Read SOCKS proxies from macOS System Configuration (#104181) 2023-05-09 10:24:29 +02:00
_ssl.c [3.12] gh-127257: ssl: Raise OSError for ERR_LIB_SYS (GH-127361) (GH-127905) 2024-12-16 15:43:57 +01:00
_ssl.h GH-103092: isolate _ssl (#104725) 2023-05-22 06:14:48 +05:30
_ssl_data.h closes bpo-40266, closes bpo-39953: Use numeric lib code if compiling against old OpenSSL. (GH-19506) 2020-04-13 22:11:40 -05:00
_ssl_data_31.h [3.12] gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174) (#105199) 2023-06-01 17:13:35 +00:00
_ssl_data_111.h [3.12] gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174) (#105199) 2023-06-01 17:13:35 +00:00
_ssl_data_300.h [3.12] gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174) (#105199) 2023-06-01 17:13:35 +00:00
_stat.c [3.12] gh-86493: Fix possible leaks in some modules initialization (GH-106768) (GH-106855) 2023-07-18 15:14:10 +03:00
_statisticsmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_struct.c [3.12] gh-125118: don't copy arbitrary values to _Bool in the struct module (GH-125169) (#125265) 2024-10-10 14:56:49 +00:00
_testbuffer.c [3.12] gh-114670: Fix _testbuffer module initialization (GH-114672) (#115272) 2024-02-11 10:53:00 +03:00
_testcapi_feature_macros.inc [3.12] gh-102304: doc: Add links to Stable ABI and Limited C API (#105345) (#105371) 2023-06-06 13:11:28 +00:00
_testcapimodule.c [3.12] gh-119585: Fix crash involving PyGILState_Release() and PyThreadState_Clear() (GH-119753) (#119861) 2024-05-31 15:42:09 +00:00
_testclinic.c [3.12] gh-118814: Fix the TypeVar constructor when name is passed by keyword (GH-122664) (GH-122807) 2024-08-08 09:49:50 +03:00
_testimportmultiple.c
_testinternalcapi.c [3.12] gh-119213: Be More Careful About _PyArg_Parser.kwtuple Across Interpreters (gh-119331) (gh-119425) 2024-05-22 22:26:58 +00:00
_testmultiphase.c gh-99113: Add a check for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104206) 2023-05-06 21:57:35 +00:00
_testsinglephase.c [3.12] gh-102251: Explicitly free state for test modules with state in test_import (GH-105085) (#105170) 2023-05-31 21:34:21 +00:00
_threadmodule.c [3.12] gh-127190: Fix local_setattro() error handling (GH-127366) (#127368) 2024-11-28 17:32:50 +00:00
_tkinter.c [3.12] gh-119614: Fix truncation of strings with embedded null characters in Tkinter (GH-120909) (GH-120939) 2024-06-24 09:39:56 +00:00
_tracemalloc.c GH-101520: Move tracemalloc functionality into core, leaving interface in Modules. (#104508) 2023-05-17 14:17:16 +01:00
_typingmodule.c gh-104549: Set __module__ on TypeAliasType (#104550) 2023-05-18 15:56:15 -07:00
_uuidmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_weakref.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_winapi.c gh-100256: Skip inaccessible registry keys in the WinAPI mimetype implementation (GH-122047) 2024-08-07 19:39:51 +01:00
_xxinterpchannelsmodule.c [3.12] gh-76785: Use Pending Calls When Releasing Cross-Interpreter Data (gh-109556) (gh-112288) 2023-11-27 14:49:48 -07:00
_xxsubinterpretersmodule.c [3.12] gh-105716: Support Background Threads in Subinterpreters Consistently (gh-109921) (gh-110707) 2023-11-27 19:01:05 -07:00
_zoneinfo.c [3.12] gh-120155: Fix Coverity issue in zoneinfo load_data() (GH-120232) (#120311) 2024-06-10 10:12:25 +00:00
addrinfo.h gh-95174: WASI: skip missing sockets functions (GH-95179) 2022-07-27 08:19:23 +02:00
arraymodule.c [3.12] gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) (GH-122013) 2024-07-19 09:08:33 +00:00
atexitmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
audioop.c [3.12] gh-46968: Fix invalid reference to Sound eXchange (SoX) 12.17.7 license (#115094) 2024-02-06 18:59:23 +01:00
binascii.c [3.12] gh-118314: Fix padding edge case in binascii.a2b_base64 strict mode (GH-118320) (GH-118691) 2024-05-07 09:35:49 +00:00
cmathmodule.c [3.12] gh-86493: Fix possible leaks in some modules initialization (GH-106768) (GH-106855) 2023-07-18 15:14:10 +03:00
config.c.in Add tests for the C tokenizer and expose it as a private module (GH-27924) 2021-08-24 17:50:05 +01:00
errnomodule.c [3.12] gh-105375: Improve errnomodule error handling (#105590) (#105596) 2023-06-09 20:36:53 +00:00
faulthandler.c [3.12] gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) (GH-122013) 2024-07-19 09:08:33 +00:00
fcntlmodule.c [3.12] Revert "[3.12] gh-69214: Fix fcntl.ioctl() request type (#119498) (#1… (#119905) 2024-06-01 17:08:07 +02:00
gc_weakref.txt Fix links to old SF bugs (#95648) 2022-08-04 18:12:35 +02:00
gcmodule.c [3.12] gh-116510: Fix crash during sub-interpreter shutdown (gh-124536) 2024-09-26 17:50:46 -07:00
getaddrinfo.c gh-74895: getaddrinfo no longer raises OverflowError (#2435) 2023-02-13 17:37:34 -08:00
getbuildinfo.c gh-81057: Move Globals in Core Code to _PyRuntimeState (gh-99496) 2022-11-15 09:45:11 -07:00
getnameinfo.c gh-95174: WASI: skip missing sockets functions (GH-95179) 2022-07-27 08:19:23 +02:00
getpath.c [3.12] gh-115136: Fix possible NULL deref in getpath_joinpath() (GH-115137) (GH-115157) 2024-02-08 11:18:38 +02:00
getpath.py gh-101543: Ensure Windows registry path is only used when stdlib can't be found (GH-101544) 2023-02-06 15:55:32 +00:00
getpath_noop.c bpo-45582: Port getpath[p].c to Python (GH-29041) 2021-12-03 00:08:42 +00:00
grpmodule.c [3.12] gh-104432: Use memcpy() to avoid misaligned loads (GH-104433) (#107355) 2023-07-27 13:52:39 -07:00
hashlib.h [3.12] gh-99108: Release the GIL around hashlib built-in computation (GH-104675) (#104776) 2023-05-23 11:24:02 +00:00
itertoolsmodule.c [3.12] gh-126618: fix repr(itertools.count(sys.maxsize)) (GH-127048) (#127510) 2024-12-02 15:19:59 +01:00
ld_so_aix.in Issue #10656: Fix out-of-tree building on AIX 2016-11-20 07:56:37 +00:00
main.c [3.12] gh-121957: Emit audit events for python -i and python -m asyncio (GH-122117) 2024-07-22 13:41:23 +02:00
makesetup gh-96269: static and shared ext need different deps (#96316) 2022-11-16 14:03:35 +01:00
makexp_aix bpo-42087: Remove support for AIX 5.3 and below (GH-22830) 2020-11-16 16:16:10 +01:00
mathmodule.c [3.12] gh-123836: workaround fmod(x, y) bug on Windows (GH-124171) (#124186) 2024-09-17 21:44:52 +02:00
md5module.c [3.12] gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237) (GH-117243) 2024-03-26 01:43:24 +00:00
mmapmodule.c gh-81489: Use Unicode APIs for mmap tagname on Windows (GH-14133) 2024-01-11 23:13:02 +00:00
nismodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
ossaudiodev.c bpo-15999: Accept arbitrary values for boolean parameters. (#15609) 2022-12-03 11:52:21 -08:00
overlapped.c [3.12] gh-91227: Ignore ERROR_PORT_UNREACHABLE in proactor recvfrom() (GH-32011) (GH-117209) 2024-03-25 12:21:31 +02:00
posixmodule.c [3.12] gh-93312: Include <sys/pidfd.h> to get PIDFD_NONBLOCK (#127593) (#127631) 2024-12-05 09:59:53 +00:00
posixmodule.h bpo-41498: Fix build on platforms without sigset_t (GH-29770) 2021-11-25 12:28:41 +01:00
pwdmodule.c [3.12] gh-116545: Fix error handling in mkpwent in pwdmodule (GH-116548) (#116593) 2024-03-11 11:55:09 +00:00
pyexpat.c [3.12] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) (GH-116248) 2024-03-06 22:01:45 +00:00
readline.c [3.12] gh-122431: Disallow negative values in readline.append_history_file (GH-122469) (#127642) 2024-12-05 18:15:30 +01:00
README
resource.c [3.12] gh-89886: Rely on HAVE_SYS_TIME_H (GH-105058) (#105192) 2023-06-01 12:08:37 +00:00
rotatingtree.c
rotatingtree.h bpo-32150: Expand tabs to spaces in C files. (#4583) 2017-11-28 17:56:10 +02:00
selectmodule.c [3.12] gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) (GH-122013) 2024-07-19 09:08:33 +00:00
Setup [3.12] gh-99108: Refresh HACL* (GH-104808) (#104893) 2023-05-24 20:55:37 +00:00
Setup.bootstrap.in gh-103763: Implement PEP 695 (#103764) 2023-05-15 20:36:23 -07:00
Setup.stdlib.in [3.12] gh-117968: Add tests for the part of the PyRun family of the C API (GH-117982) (GH-118011) 2024-04-22 18:59:28 +00:00
sha1module.c [3.12] gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237) (GH-117243) 2024-03-26 01:43:24 +00:00
sha2module.c [3.12] gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237) (GH-117243) 2024-03-26 01:43:24 +00:00
sha3module.c [3.12] gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237) (GH-117243) 2024-03-26 01:43:24 +00:00
signalmodule.c [3.12] gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) (GH-122013) 2024-07-19 09:08:33 +00:00
socketmodule.c [3.12] gh-126876: Fix socket internal_select() for large timeout (GH-126968) (#127003) 2024-12-03 14:12:59 +00:00
socketmodule.h gh-103092: Isolate socket module (#103094) 2023-04-09 06:33:52 +05:30
spwdmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
symtablemodule.c [3.12] gh-110045: Update symtable module for PEP 695 (GH-110066) (#110070) 2023-09-29 08:10:22 +02:00
syslogmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
termios.c [3.12] gh-114492: Initialize struct termios before calling tcgetattr() (GH-114495) (GH-114502) 2024-01-23 22:02:02 +00:00
timemodule.c [3.12] gh-52551: Fix encoding issues in strftime() (GH-125193) (GH-125657) (GH-125661) 2024-10-17 20:04:48 +00:00
tkappinit.c gh-103538: Remove unused TK_AQUA code (GH-103539) 2023-05-10 18:53:13 +00:00
tkinter.h gh-103532: Remove TKINTER_PROTECT_LOADTK code (GH-103535) 2023-04-14 09:04:16 -05:00
unicodedata.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
unicodedata_db.h closes gh-96734: Update to Unicode 15.0.0. (GH-96809) 2022-09-13 15:45:12 -07:00
unicodename_db.h closes gh-96734: Update to Unicode 15.0.0. (GH-96809) 2022-09-13 15:45:12 -07:00
winreparse.h bpo-31512: Add non-elevated symlink support for Windows (GH-3652) 2019-04-09 11:19:46 -07:00
xxlimited.c [3.12] gh-110968: Py_MOD_PER_INTERPRETER_GIL_SUPPORTED was added to 3.12 (#111588) 2023-11-01 18:13:31 +01:00
xxlimited_35.c [3.12] gh-110968: Py_MOD_PER_INTERPRETER_GIL_SUPPORTED was added to 3.12 (#111588) 2023-11-01 18:13:31 +01:00
xxmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
xxsubtype.c [3.12] gh-86493: Fix possible leaks in modules initialization: _curses_panel, _decimal, posix, xxsubtype (GH-106767) (#106849) 2023-07-18 10:03:59 +03:00
zlibmodule.c [3.12] gh-105967: Work around a macOS bug, limit zlib C library crc32 API calls to 1gig (GH-112615) (#112724) 2023-12-04 20:29:23 +00:00

Source files for standard library extension modules,
and former extension modules that are now builtin modules.