This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: random.seed with string and version 1 not deterministic in 3.5.2
Type: behavior Stage: resolved
Components: Versions: Python 3.5
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: mark.dickinson, mfthomps
Priority: normal Keywords:

Created on 2019-12-11 00:25 by mfthomps, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg358236 - (view) Author: Michael Thompson (mfthomps) Date: 2019-12-11 00:25
Version 3.5.2, the "rand string seed" is not deterministic in code sample below across multiple invocations of the program.  Python 3.6.8 works fine.

#!/usr/bin/env python3
import random
lis = '94'
random.seed(lis, version=1)
w = random.random() * 100
print('rand string seed: %d' % w)
lis = 94
random.seed(lis, version=1)
w = random.random() * 100
print('rand int seed: %d' % w)


Running in a Docker container: uname -a:
Linux formatstring-igrader 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
msg358239 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2019-12-11 01:10
I think this was already fixed in 3.5, but the fix would have gone in later than the 3.5.2 release: see issue #27706. 3.5.3 and later should have the fix.
msg358240 - (view) Author: Michael Thompson (mfthomps) Date: 2019-12-11 01:28
Thanks.  I found 3.6 works for me.
--Mike

On Tue, Dec 10, 2019 at 5:10 PM Mark Dickinson <report@bugs.python.org>
wrote:

>
> Mark Dickinson <dickinsm@gmail.com> added the comment:
>
> I think this was already fixed in 3.5, but the fix would have gone in
> later than the 3.5.2 release: see issue #27706. 3.5.3 and later should have
> the fix.
>
> ----------
> nosy: +mark.dickinson
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue39023>
> _______________________________________
>
History
Date User Action Args
2022-04-11 14:59:24adminsetgithub: 83204
2019-12-11 01:41:51rhettingersetstatus: open -> closed
resolution: out of date
stage: resolved
2019-12-11 01:28:36mfthompssetmessages: + msg358240
2019-12-11 01:10:39mark.dickinsonsetnosy: + mark.dickinson
messages: + msg358239
2019-12-11 00:25:38mfthompscreate