[Python-bugs-list] [ python-Bugs-745478 ] Buglet in email/Generator.py (2.2.3c1!)
SourceForge.net
noreply@sourceforge.net
Thu, 29 May 2003 05:08:57 -0700
Bugs item #745478, was opened at 2003-05-29 14:08
Message generated for change (Tracker Item Submitted) made by Item Submitter
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: Open
Resolution: None
Priority: 5
Submitted By: Geert Jansen (geertj)
Assigned to: Nobody/Anonymous (nobody)
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
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=745478&group_id=5470