This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pekka.klarck
Recipients mark.dickinson, pekka.klarck, petr.viktorin, rhettinger, skrah
Date 2018-09-06.07:29:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1536218950.79.0.56676864532.issue26208@psf.upfronthosting.co.za>
In-reply-to
Content
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 "<stdin>", line 1, in <module>
    decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]


With Python 2.7 I get this error instead:

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


I'm writing type conversion code and was planning to include the error message by Python along with some higher level explanation when reporting errors. `[<class 'decimal.ConversionSyntax'>]` would be such a strange message that I need to make a special case with decimal.
History
Date User Action Args
2018-09-06 07:29:10pekka.klarcksetrecipients: + pekka.klarck, rhettinger, mark.dickinson, petr.viktorin, skrah
2018-09-06 07:29:10pekka.klarcksetmessageid: <1536218950.79.0.56676864532.issue26208@psf.upfronthosting.co.za>
2018-09-06 07:29:10pekka.klarcklinkissue26208 messages
2018-09-06 07:29:10pekka.klarckcreate