Bugs item #1770009, was opened at 2007-08-08 09:44 Message generated for change (Comment added) made by facundobatista You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1770009&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: John Machin (sjmachin) Assigned to: Facundo Batista (facundobatista) Summary: decimal.Decimal("trash") produces informationless exception Initial Comment: Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import decimal >>> decimal.Decimal("-$123,456.78") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\python25\lib\decimal.py", line 614, in __new__ self._sign, self._int, self._exp = context._raise_error(ConversionSyntax) File "C:\python25\lib\decimal.py", line 2325, in _raise_error raise error, explanation decimal.InvalidOperation It should do something like float does ... better message, and show the offending arg: >>> float("-$123,456.78") Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: invalid literal for float(): -$123,456.78 >>> ---------------------------------------------------------------------- >Comment By: Facundo Batista (facundobatista) Date: 2007-08-15 12:14 Message: Logged In: YES user_id=752496 Originator: NO Fixed, both in trunk and in the decimal-branch: >>> import decimal >>> decimal.Decimal("-$123,456.78") Traceback (most recent call last): ... decimal.InvalidOperation: Invalid literal for Decimal: '-$123,456.78' >>> ---------------------------------------------------------------------- Comment By: Facundo Batista (facundobatista) Date: 2007-08-13 12:17 Message: Logged In: YES user_id=752496 Originator: NO Yes, I will. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2007-08-10 00:36 Message: Logged In: YES user_id=33168 Originator: NO Facundo, could you take a look? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1770009&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com