UnicodeDecodeError when importing random? (running with -U)

Ben benjamin.han at gmail.com
Fri Apr 13 00:10:44 EDT 2007


Is the following a known bug?

[temp]$  python -U
Python 2.4.4 (#1, Oct 23 2006, 13:58:18)
[GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import random
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib64/python2.4/random.py", line 834, in ?
    _inst = Random()
  File "/usr/lib64/python2.4/random.py", line 94, in __init__
    self.seed(x)
  File "/usr/lib64/python2.4/random.py", line 108, in seed
    a = long(_hexlify(_urandom(16)), 16)
  File "/usr/lib64/python2.4/os.py", line 723, in urandom
    bytes += read(_urandomfd, n - len(bytes))
UnicodeDecodeError: 'ascii' codec can't decode byte 0x97 in position
0: ordinal not in range(128)




More information about the Python-list mailing list