cpython/Modules
George Alexopoulos 8717f792f7
gh-126554: ctypes: Correctly handle NULL dlsym values (GH-126555)
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: 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-11-15 11:05:51 +01:00
..
_ctypes gh-126554: ctypes: Correctly handle NULL dlsym values (GH-126555) 2024-11-15 11:05:51 +01:00
_decimal gh-126133: Only use start year in PSF copyright, remove end years (#126236) 2024-11-12 15:59:19 +02:00
_hacl gh-126433: Update hacl-star (GH-126791) 2024-11-15 00:22:50 +00:00
_io gh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564) 2024-11-08 14:23:50 +02:00
_multiprocessing gh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564) 2024-11-08 14:23:50 +02:00
_sqlite gh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564) 2024-11-08 14:23:50 +02:00
_sre gh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564) 2024-11-08 14:23:50 +02:00
_ssl gh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564) 2024-11-08 14:23:50 +02:00
_testcapi gh-123619: Add an unstable C API function for enabling deferred reference counting (GH-123635) 2024-11-13 13:27:16 +00:00
_testinternalcapi Fixes loop variables to be the same types as their limit (GH-120958) 2024-06-24 17:11:47 +01:00
_testlimitedcapi gh-124502: Add PyUnicode_Equal() function (#124504) 2024-10-07 21:24:53 +00:00
_xxtestfuzz gh-121023: Improve `_xxtestfuzz/README.rst` (#121024) 2024-09-16 23:28:09 +03:00
cjkcodecs gh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564) 2024-11-08 14:23:50 +02:00
clinic gh-125916: Allow functools.reduce() 'initial' to be a keyword argument (#125917) 2024-11-12 13:11:58 +00:00
expat gh-126623: Update libexpat to 2.6.4, make future updates easier (GH-126792) 2024-11-13 18:31:20 +00:00
README
Setup GH-99108: Amend Modules/Setup (#123146) 2024-08-23 08:40:31 +02:00
Setup.bootstrap.in gh-121554: remove unnecessary internal functions in compile.c (#121555) 2024-07-10 23:48:37 +01:00
Setup.stdlib.in gh-111495: Add tests for `PyCodec_*` C API (#123343) 2024-09-29 15:22:39 +00:00
_abc.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
_asynciomodule.c gh-126405: fix use-after-free in `_asyncio.Future.remove_done_callback` (#126733) 2024-11-12 18:01:34 +05:30
_bisectmodule.c gh-126035: add missing whitespace to *Py_EnterRecursiveCall() messages (#126036) 2024-10-27 22:55:48 +01:00
_bz2module.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
_codecsmodule.c gh-124665: Add `_PyCodec_UnregisterError` and `_codecs._unregister_error` (#124677) 2024-09-29 02:25:23 +02:00
_collectionsmodule.c gh-124153: Remove `_PyType_GetModuleByDef2` private function (GH-124261) 2024-09-26 18:21:11 +02:00
_complex.h gh-61103: Support float and long double complex types in ctypes module (#121248) 2024-07-03 11:08:11 +02:00
_contextvarsmodule.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
_csv.c gh-116738: Make `_csv` module thread-safe (#118344) 2024-10-11 23:25:36 +05:30
_curses_panel.c gh-113565: Improve and harden detection of curses dependencies (#119816) 2024-07-01 08:10:03 +00:00
_cursesmodule.c gh-126313: Fix a crash in curses.napms() due to incorrect error handling (GH-126351) 2024-11-03 15:08:34 +00:00
_datetimemodule.c gh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_STR) (#125583) 2024-10-25 11:14:52 +02:00
_dbmmodule.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
_elementtree.c gh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_STR) (#125194) 2024-10-09 17:15:23 +02:00
_functoolsmodule.c gh-126133: Only use start year in PSF copyright, remove end years (#126236) 2024-11-12 15:59:19 +02:00
_gdbmmodule.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
_hashopenssl.c gh-122854: Add Py_HashBuffer() function (#122855) 2024-08-30 15:42:27 +00:00
_heapqmodule.c Remove almost all unpaired backticks in docstrings (#119231) 2024-05-22 12:35:18 -04:00
_interpchannelsmodule.c gh-76785: Improved Subinterpreters Compatibility with 3.12 (2/2) (gh-126707) 2024-11-12 10:41:51 -07:00
_interpqueuesmodule.c gh-76785: Improved Subinterpreters Compatibility with 3.12 (2/2) (gh-126707) 2024-11-12 10:41:51 -07:00
_interpreters_common.h gh-76785: Improved Subinterpreters Compatibility with 3.12 (2/2) (gh-126707) 2024-11-12 10:41:51 -07:00
_interpretersmodule.c gh-76785: Improved Subinterpreters Compatibility with 3.12 (2/2) (gh-126707) 2024-11-12 10:41:51 -07:00
_json.c gh-95382: Use cache for indentations in the JSON encoder (GH-118636) 2024-11-12 17:19:15 +00:00
_localemodule.c gh-124969: Make locale.nl_langinfo(locale.ALT_DIGITS) returning a string again (GH-125774) 2024-10-21 18:54:12 +00:00
_lsprof.c gh-126425: Refactor `_lsprof_Profiler_enable` (#126426) 2024-11-05 15:23:24 +03:00
_lzmamodule.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
_math.h gh-122681: remove m_atan2()/c_atan2() helpers (#122715) 2024-08-17 13:48:16 +05:30
_opcode.c gh-115999: Implement thread-local bytecode and enable specialization for `BINARY_OP` (#123926) 2024-11-04 11:13:32 -08:00
_operator.c gh-115808: Add ``is_none`` and ``is_not_none`` to ``operator`` (#115814) 2024-08-10 20:16:34 +01:00
_pickle.c gh-125631: Enable setting persistent_id and persistent_load of pickler and unpickler (GH-125752) 2024-11-07 08:53:02 +02:00
_posixsubprocess.c gh-121381 Remove subprocess._USE_VFORK escape hatch (#121383) 2024-07-30 18:39:54 -07:00
_queuemodule.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
_randommodule.c gh-123497: New limit for Python integers on 64-bit platforms (GH-123724) 2024-09-29 10:40:20 +03:00
_scproxy.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
_ssl.c gh-126455: Disallow _ssl.SSLSocket instantiation (#126481) 2024-11-06 11:59:39 +01:00
_ssl.h GH-103092: isolate `_ssl` (#104725) 2023-05-22 06:14:48 +05:30
_ssl_data_31.h gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (#105174) 2023-06-01 09:42:18 -07:00
_ssl_data_111.h gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (#105174) 2023-06-01 09:42:18 -07:00
_ssl_data_300.h gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (#105174) 2023-06-01 09:42:18 -07:00
_stat.c Fix typos in docs, error messages and comments (#123336) 2024-08-28 14:41:04 +03:00
_statisticsmodule.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
_struct.c gh-125118: don't copy arbitrary values to _Bool in the struct module (GH-125169) 2024-10-10 14:42:03 +02:00
_suggestions.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
_sysconfig.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
_testbuffer.c gh-120674: Protect multi-line macros in _testbuffer.c and _testcapimodule.c (#120675) 2024-06-18 12:04:52 +00:00
_testcapi_feature_macros.inc gh-91325: Skip Stable ABI checks with Py_TRACE_REFS special build (GH-92046) 2024-01-29 16:45:31 +01:00
_testcapimodule.c gh-121654: Add PyType_Freeze() function (#122457) 2024-10-25 11:12:48 +02:00
_testclinic.c gh-122943: Remove the object converter for var-positional parameter (GH-126560) 2024-11-08 05:41:54 +00:00
_testclinic_limited.c gh-116322: Rename PyModule_ExperimentalSetGIL to PyUnstable_Module_SetGIL (GH-118645) 2024-05-06 18:59:36 +02:00
_testexternalinspection.c gh-125604: Move _Py_AuditHookEntry, etc. Out of pycore_runtime.h (gh-125605) 2024-10-18 09:26:08 -06:00
_testimportmultiple.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
_testinternalcapi.c gh-123619: Add an unstable C API function for enabling deferred reference counting (GH-123635) 2024-11-13 13:27:16 +00:00
_testlimitedcapi.c gh-111495: Add tests for `PyCodec_*` C API (#123343) 2024-09-29 15:22:39 +00:00
_testmultiphase.c gh-116322: Rename PyModule_ExperimentalSetGIL to PyUnstable_Module_SetGIL (GH-118645) 2024-05-06 18:59:36 +02:00
_testsinglephase.c gh-123880: Allow recursive import of single-phase-init modules (GH-123950) 2024-09-20 10:27:34 +02:00
_threadmodule.c gh-125139: use `_PyRecursiveMutex` in `_thread.RLock` (#125144) 2024-10-14 14:06:31 +05:30
_tkinter.c gh-124111: Update tkinter for compatibility with Tcl/Tk 9.0.0 (GH-124156) 2024-11-14 12:45:08 -06:00
_tracemalloc.c gh-116322: Rename PyModule_ExperimentalSetGIL to PyUnstable_Module_SetGIL (GH-118645) 2024-05-06 18:59:36 +02:00
_typingmodule.c gh-123448: Move `_PyNoDefault_Type` to the static types array (#123449) 2024-08-28 18:27:40 -07:00
_uuidmodule.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
_weakref.c gh-120974: Make _asyncio._leave_task atomic in the free-threaded build (#122139) 2024-07-23 17:06:03 +00:00
_winapi.c gh-126433: Fix compiler warnings on 32-bit Windows (#126444) 2024-11-05 16:05:13 +01:00
_zoneinfo.c gh-125243: Fix ZoneInfo data race in free threading build (#125281) 2024-10-13 16:17:51 -04:00
addrinfo.h gh-95174: WASI: skip missing sockets functions (GH-95179) 2022-07-27 08:19:23 +02:00
arraymodule.c gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) 2024-07-19 08:06:02 +00:00
atexitmodule.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
binascii.c gh-118314: Fix padding edge case in binascii.a2b_base64 strict mode (GH-118320) 2024-05-07 11:18:45 +02:00
blake2module.c gh-126433: Fix compiler warnings on 32-bit Windows (#126444) 2024-11-05 16:05:13 +01:00
cmathmodule.c gh-120026: soft deprecate Py_HUGE_VAL macro (#120027) 2024-11-01 22:04:31 +00:00
config.c.in gh-104169: Fix test_peg_generator after tokenizer refactoring (#110727) 2023-10-12 09:34:35 +02:00
errnomodule.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
faulthandler.c gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) 2024-07-19 08:06:02 +00:00
fcntlmodule.c gh-116622: Don't expose `FICLONE` ioctl on Android (#122522) 2024-08-01 00:23:10 +00:00
gc_weakref.txt Fix links to old SF bugs (#95648) 2022-08-04 18:12:35 +02:00
gcmodule.c gh-122943: Rework support of var-positional parameter in Argument Clinic (GH-122945) 2024-11-07 23:40:03 +02:00
getaddrinfo.c gh-108767: Replace ctype.h functions with pyctype.h functions (#108772) 2023-09-01 18:36:53 +02:00
getbuildinfo.c gh-106320: Remove private pylifecycle.h functions (#106400) 2023-07-04 09:41:43 +00:00
getnameinfo.c gh-95174: WASI: skip missing sockets functions (GH-95179) 2022-07-27 08:19:23 +02:00
getpath.c gh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_STR) (#125583) 2024-10-25 11:14:52 +02:00
getpath.py gh-121103: Put free-threaded libraries in `lib/python3.14t` (#121293) 2024-07-11 16:21:37 -04:00
getpath_noop.c bpo-45582: Port getpath[p].c to Python (GH-29041) 2021-12-03 00:08:42 +00:00
grpmodule.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
hashlib.h gh-111863: Rename `Py_NOGIL` to `Py_GIL_DISABLED` (#111864) 2023-11-20 15:52:00 +02:00
itertoolsmodule.c gh-126595: fix a crash when calling `itertools.count(sys.maxsize)` (#126617) 2024-11-12 14:10:10 +01:00
ld_so_aix.in
main.c gh-121957: Emit audit events for `python -i` and `python -m asyncio` (GH-121958) 2024-07-22 13:04:08 +02:00
makesetup gh-116622: Rename build variable MODULE_LDFLAGS back to LIBPYTHON (#122764) 2024-08-09 00:00:55 +02: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 gh-122943: Rework support of var-positional parameter in Argument Clinic (GH-122945) 2024-11-07 23:40:03 +02:00
md5module.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
mmapmodule.c gh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_BYTES) (#125195) 2024-10-09 17:12:11 +02:00
overlapped.c gh-121040: Use __attribute__((fallthrough)) (#121044) 2024-06-27 09:58:44 +00:00
posixmodule.c gh-126688: Reinit import lock after fork (#126692) 2024-11-12 15:53:58 -05:00
posixmodule.h gh-85283: Convert grp extension to the limited C API (#116611) 2024-03-12 00:46:53 +00:00
pwdmodule.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
pyexpat.c GH-119462: Enforce invariants of type versioning (GH-120731) 2024-06-19 17:38:45 +01:00
readline.c gh-116322: Rename PyModule_ExperimentalSetGIL to PyUnstable_Module_SetGIL (GH-118645) 2024-05-06 18:59:36 +02:00
resource.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
rotatingtree.c gh-116181: Remove Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE in rotatingtree.c (#121260) 2024-07-03 13:05:05 +05:30
rotatingtree.h
selectmodule.c Fix typos in docs, error messages and comments (#123336) 2024-08-28 14:41:04 +03:00
sha1module.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
sha2module.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
sha3module.c Fix typos in docs, error messages and comments (#123336) 2024-08-28 14:41:04 +03:00
signalmodule.c gh-123014: Disable pidfd API on older Android versions (#124458) 2024-09-25 16:23:30 +02:00
socketmodule.c gh-118986: expose `socket.IPV6_RECVERR` (#118987) 2024-10-17 20:49:12 +03:00
socketmodule.h gh-124944: Add socket.SO_ORIGINAL_DST (#124945) 2024-10-15 00:36:38 +02:00
symtablemodule.c gh-119933: Improve ``SyntaxError`` message for invalid type parameters expressions (#119976) 2024-06-17 06:51:03 -07:00
syslogmodule.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
termios.c gh-119770: Make termios ioctl() constants positive (#119840) 2024-05-31 17:18:40 +02:00
timemodule.c gh-52551: Use wcsftime() to implement time.strftime() on Windows (GH-125658) 2024-10-19 11:29:51 +03: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-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_STR) (#125194) 2024-10-09 17:15:23 +02:00
unicodedata_db.h closes gh-124016: update Unicode to 16.0.0 (#124017) 2024-09-13 07:47:04 -07:00
unicodename_db.h closes gh-124016: update Unicode to 16.0.0 (#124017) 2024-09-13 07:47:04 -07:00
winreparse.h
xxlimited.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
xxlimited_35.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
xxmodule.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
xxsubtype.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
zlibmodule.c gh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_BYTES) (#125195) 2024-10-09 17:12:11 +02:00

README

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