Crash report
What happened?
import decimal
decimal.Context.rounding.__delete__(decimal.Context())
Segmentation fault (core dumped)
context_setround() passes the value to getround(), which calls
PyUnicode_Check() on it without checking it for NULL, and the setter is
called with NULL when the attribute is deleted. Plain del ctx.rounding is
safe, because context_setattr() rejects deletion — but it is bypassed by
calling the descriptor.
The other five Context getsets do not crash, but raise SystemError:
import decimal
decimal.Context.prec.__delete__(decimal.Context())
# SystemError: ../Objects/longobject.c:577: bad argument to internal function
Same for Emin, Emax, capitals and clamp.
CPython versions tested on:
3.15, 3.14, 3.13, 3.12
Operating systems tested on:
Windows
Output from running 'python -VV' on the command line:
Python 3.12.3 (main, Jan 8 2026, 11:30:50) [GCC 13.3.0] / Python 3.14.2 (main, Dec 17 2025, 21:10:36) [MSC v.1944 64 bit (AMD64)]
Crash report
What happened?
context_setround()passes the value togetround(), which callsPyUnicode_Check()on it without checking it forNULL, and the setter iscalled with
NULLwhen the attribute is deleted. Plaindel ctx.roundingissafe, because
context_setattr()rejects deletion — but it is bypassed bycalling the descriptor.
The other five
Contextgetsets do not crash, but raiseSystemError:Same for
Emin,Emax,capitalsandclamp.CPython versions tested on:
3.15, 3.14, 3.13, 3.12
Operating systems tested on:
Windows
Output from running 'python -VV' on the command line:
Python 3.12.3 (main, Jan 8 2026, 11:30:50) [GCC 13.3.0] / Python 3.14.2 (main, Dec 17 2025, 21:10:36) [MSC v.1944 64 bit (AMD64)]