New submission from Terrence Cole <terre...@zettabytestorage.com>:

This code:
>>> random.seed(b'foo')
>>> random.getrandbits(8)
...repeated 7 more times...

Yields the sequence of values:
amd64: 227, 199,  34, 218,  83, 115, 236, 254
x86:   245, 198, 204,  66, 219,   4, 168,  93

Comments in the source seem to indicate random should produce the same results 
on all platforms.

I first thought that the seed was not resetting the state correctly, however, 
if I do a 'random.setstate( (3,(0,)*625,None) )' before seeding the generator, 
the results do not change from what is given above.  Also, calls to getrandbits 
after the setstate, but before another seed, correctly return 0.  It seems from 
this that seed is resetting the state properly, but some of the internals are 
not 32bit/64bit consistent.

----------
components: Library (Lib)
messages: 99078
nosy: terrence
severity: normal
status: open
title: random produces different output on different architectures
type: behavior
versions: Python 3.1

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7889>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to