[New-bugs-announce] [issue27941] Bad error message from Decimal('garbage') across the py3 range

Samuele Santi report at bugs.python.org
Fri Sep 2 12:31:27 EDT 2016


New submission from Samuele Santi:

Looks like, on some occasions, running ``Decimal('garbage')`` on Python 3.x decimal raises this error:

    decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]

instead of the usual:

    decimal.InvalidOperation: Invalid literal for Decimal: 'garbage'


This seems to be caused by the built-in decimal module on 3.x, while it's just fine with decimal.py / _pydecimal.py (eg. the system Python on Archlinux).

I'm attaching the output from a few tests I made against different interpreters.

----------
files: test-decimal-error-output.txt
messages: 274254
nosy: Samuele Santi
priority: normal
severity: normal
status: open
title: Bad error message from Decimal('garbage') across the py3 range
type: behavior
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file44350/test-decimal-error-output.txt

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27941>
_______________________________________


More information about the New-bugs-announce mailing list