-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirstdlibPython modules in the Lib dirPython modules in the Lib dirtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Description
Crash report
- Three-argument
pow()
with non-Decimal first argument does not work in the Python implementation.
>>> from decimal import Decimal
>>> pow(10, Decimal(2), 7)
Decimal('2')
>>> from _pydecimal import Decimal
>>> pow(10, Decimal(2), 7)
Traceback (most recent call last):
File "<python-input-3>", line 1, in <module>
pow(10, Decimal(2), 7)
~~~^^^^^^^^^^^^^^^^^^^
TypeError: unsupported operand type(s) for ** or pow(): 'int', 'Decimal', 'int'
But it works in the C implementation.
- Three-argument
pow()
with only Decimal third argument crashes in the C implementation.
>>> from decimal import Decimal
>>> pow(10, 2, Decimal(7))
python: ./Modules/_decimal/_decimal.c:139: find_state_left_or_right: Assertion `mod != NULL' failed.
Aborted (core dumped)
In the Python implementation it only raises TypeError, which is expected.
Linked PRs
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirstdlibPython modules in the Lib dirPython modules in the Lib dirtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump