[issue6850] decimal.py: format_dict

2009-09-07 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the report. I've fixed the order of the checks as Eric suggested in r74704 (trunk), r74705 (release26-maint), r74706 (py3k) and r74707 (release31-maint). -- resolution: -> fixed stage: -> committed/rejected status: open -> closed version

[issue6850] decimal.py: format_dict

2009-09-07 Thread Stefan Krah
Stefan Krah added the comment: Yes, I'll do that. - The tracker has eaten my examples, so hopefully this goes through: 1. format(Decimal("0.12345"), "7.1") -> '0.1' 2. format(Decimal("0.12345"), "7.0g") -> '0.1' 3. format(Decimal("0.12345"), "7.0") Traceback (most recent call l

[issue6850] decimal.py: format_dict

2009-09-07 Thread Eric Smith
Eric Smith added the comment: The format string is valid. Sorry for the noise. The fill character of 'a' threw me off. With my suggested change to decimal.py, line 5595, in py3k: >>> from decimal import * >>> format(Decimal("0.12345"), "a=-7.0") '0.1' >>> format(0.12345, "a=-7.0") '0.1'

[issue6850] decimal.py: format_dict

2009-09-07 Thread Stefan Krah
Stefan Krah added the comment: Eric Smith wrote: > The test as written will always give an error for None. I think the > better fix is to change it to be: > > if format_dict['type'] is None or format_dict['type'] in 'gG': > > That "fixes" this particular exception, but since the format specif

[issue6850] decimal.py: format_dict['type'] not initialized

2009-09-07 Thread Eric Smith
Changes by Eric Smith : -- components: +Library (Lib) type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue6850] decimal.py: format_dict['type'] not initialized

2009-09-07 Thread Eric Smith
Eric Smith added the comment: The test as written will always give an error for None. I think the better fix is to change it to be: if format_dict['type'] is None or format_dict['type'] in 'gG': That "fixes" this particular exception, but since the format specifier is invalid, it produces nons

[issue6850] decimal.py: format_dict['type'] not initialized

2009-09-07 Thread Eric Smith
Changes by Eric Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue6850] decimal.py: format_dict['type'] not initialized

2009-09-06 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- assignee: -> marketdickinson nosy: +marketdickinson ___ Python tracker ___ ___ Python-bugs-list mail

[issue6850] decimal.py: format_dict['type'] not initialized

2009-09-06 Thread Stefan Krah
New submission from Stefan Krah : Hi, it looks like format_dict['type'] is not always initialized: >>> from decimal import * >>> format(Decimal("0.12345"), "a=-7.0") Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.1/decimal.py", line 3611, in __format__ sp