[Python-bugs-list] [ python-Bugs-745478 ] Buglet in email/Generator.py (2.2.3c1!)
SourceForge.net
noreply@sourceforge.net
Thu, 29 May 2003 12:34:18 -0700
Bugs item #745478, was opened at 2003-05-29 08:08
Message generated for change (Comment added) made by bwarsaw
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=745478&group_id=5470
Category: Python Library
Group: Python 2.2.2
>Status: Closed
>Resolution: Fixed
Priority: 9
Submitted By: Geert Jansen (geertj)
Assigned to: Barry A. Warsaw (bwarsaw)
Summary: Buglet in email/Generator.py (2.2.3c1!)
Initial Comment:
Hi,
there seems to be a bug in the "email" package,
file "Generator.py". At line 362, a random digit string is
needed. This is done like this:
dp = locale.localeconv().get('decimal_point')
r = repr(random.random()).split(dp)[1]
The problem is that repr() doesn't use the locale, so
when the decimal_point is not equal to ".", split() returns
only one entry and the [1] index fails.
Suggested fix: either use:
r = repr(random.random())[1:]
or:
r = repr(random.randint(0, sys.maxint-1))
The same problem is in 2.3b1.
Geert
----------------------------------------------------------------------
>Comment By: Barry A. Warsaw (bwarsaw)
Date: 2003-05-29 15:34
Message:
Logged In: YES
user_id=12800
On further reflection w/ BDFL, we'll include the patch but
not the test, since it's testing the old code which we're
replacing anyway. ;)
----------------------------------------------------------------------
Comment By: Barry A. Warsaw (bwarsaw)
Date: 2003-05-29 15:26
Message:
Logged In: YES
user_id=12800
Please try this patch. After applying, please run the full
Python 2.2.3 test suite. If there are no regressions in
your locale, then I might be willing to add it to 2.2.3
final. But the test makes me nervous.
----------------------------------------------------------------------
Comment By: Barry A. Warsaw (bwarsaw)
Date: 2003-05-29 09:04
Message:
Logged In: YES
user_id=12800
Cranking priority to 9 so this has to get fixed before 2.2.3
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=745478&group_id=5470