[issue26208] decimal C module's exceptions don't match the Python version

2022-03-02 Thread Constantine Evans
Constantine Evans added the comment: Some other non-matching exceptions are unfriendly, but do not come from libmpdec and could be made to match without, I think, causing problems. For example: >>> format(_decimal.Decimal(1), "invalid") ... ValueError: invalid format string

[issue26208] decimal C module's exceptions don't match the Python version

2022-01-04 Thread Cédric Krier
Change by Cédric Krier : -- nosy: +ced ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26208] decimal C module's exceptions don't match the Python version

2018-09-06 Thread Stefan Krah
Stefan Krah added the comment: pypy3 actually took over the terse exceptions, but without the conditions. They'd also need error codes from libmpdec now. huge = Decimal('9' * 99) huge.quantize(Decimal('0.1')) Traceback (most recent call last): File "", line 1, in File

[issue26208] decimal C module's exceptions don't match the Python version

2018-09-06 Thread Stefan Krah
Stefan Krah added the comment: The thing is that Python explicitly supports any object as the "message". I was quite pleased when I discovered that because it provides a way to include both signals and the condition list in the "message", which can be used in programs for dispatching on the

[issue26208] decimal C module's exceptions don't match the Python version

2018-09-06 Thread Pekka Klärck
Pekka Klärck added the comment: Just noticed this myself when testing with Python 3.5-3.7: >>> from decimal import Decimal >>> d = Decimal('foo') Traceback (most recent call last): File "", line 1, in decimal.InvalidOperation: [] With Python 2.7 I get this error

[issue26208] decimal C module's exceptions don't match the Python version

2016-09-02 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___

[issue26208] decimal C module's exceptions don't match the Python version

2016-01-26 Thread Petr Viktorin
New submission from Petr Viktorin: Exceptions from the decimal module are quite unfriendly: >>> Decimal(42) / Decimal(0) ... decimal.DivisionByZero: [] >>> huge = Decimal('9' * 99) >>> huge.quantize(Decimal('0.1')) ... decimal.InvalidOperation: [] compared to the

[issue26208] decimal C module's exceptions don't match the Python version

2016-01-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: If it doesn't take too much effort, I would like the see the exception messages made more user friendly and kept more in-sync with the pure Python version. -- assignee: -> skrah nosy: +rhettinger ___ Python

[issue26208] decimal C module's exceptions don't match the Python version

2016-01-26 Thread Stefan Krah
Stefan Krah added the comment: Yes, ideally the exceptions should be in sync. I don't find the list of signals entirely uninteresting, but implementing it in _pydecimal would require #8613 to be solved, which is unlikely to happen. In _decimal the exceptions come directly from libmpdec, so in

[issue26208] decimal C module's exceptions don't match the Python version

2016-01-26 Thread Stefan Krah
Changes by Stefan Krah : -- stage: -> needs patch type: -> enhancement versions: +Python 3.6 ___ Python tracker ___