]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-145966: Fix _csv DIALECT_GETATTR macro silently masking non-AttributeError excepti...
authorRamin Farajpour Cami <ramin.blackhat@gmail.com>
Tue, 17 Mar 2026 15:08:53 +0000 (18:38 +0330)
committerGitHub <noreply@github.com>
Tue, 17 Mar 2026 15:08:53 +0000 (16:08 +0100)
commitdc24b8a6d42231ebc821baeda662e1168b52aa26
treec86a6f4103247f2ca9c0a2b74d4b70581a03b7cd
parent1efd9939c8742a251f232f09ccd0c1def7fda66e
gh-145966: Fix _csv DIALECT_GETATTR macro silently masking non-AttributeError exceptions (GH-145974)

The DIALECT_GETATTR macro in dialect_new() unconditionally called
PyErr_Clear() when PyObject_GetAttrString() failed, which suppressed
all exceptions including MemoryError, KeyboardInterrupt, and
RuntimeError. Now only AttributeError is cleared; other exceptions
propagate via the existing error handling path.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Lib/test/test_csv.py
Misc/NEWS.d/next/Library/2026-03-15-00-00-00.gh-issue-145966.tCI0uD4I.rst [new file with mode: 0644]
Modules/_csv.c