SIGN IN SIGN UP

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>
R
Ramin Farajpour Cami committed
dc24b8a6d42231ebc821baeda662e1168b52aa26
Parent: 1efd993
Committed by GitHub <noreply@github.com> on 3/17/2026, 3:08:53 PM