Issue 31482: random.seed() doesn't work with bytes and version=1 (original) (raw)

Created on 2017-09-15 12:10 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 3614 merged rhettinger,2017-09-16 09:02
PR 3629 closed python-dev,2017-09-17 16:04
PR 3659 merged python-dev,2017-09-19 16:29
Messages (12)
msg302246 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-15 12:10
The behavior of random.seed() with bytes and version=1 is specially documented. But actually it doesn't work. >>> import random >>> random.seed(b'abc', version=1) Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/random.py", line 113, in seed x = ord(a[0]) << 7 if a else 0 TypeError: ord() expected string of length 1, but int found
msg302370 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-09-17 16:04
New changeset 132a7d7cdbc7cb89fa1c1f4e8192241c3d68f549 by Raymond Hettinger in branch 'master': bpo-31482: Missing bytes support for random.seed() version 1 (#3614) https://github.com/python/cpython/commit/132a7d7cdbc7cb89fa1c1f4e8192241c3d68f549
msg302512 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-19 10:06
Raymond, why the fix is not backported to 3.6?
msg302535 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-09-19 15:58
Mariatta, what is the procedure for completing the backport? I can see the miss-islington bot made a commit but it didn't take in the 3.6 branch.
msg302538 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-19 16:19
What is wrong with PR 3629?
msg302540 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-09-19 16:29
Hi Raymond, Somehow the backport PR https://github.com/python/cpython/pull/3629 was closed before instead of merged. To retrigger the backport, we can re-apply the "needs backport to 3.6" label on the original PR (3614). I will do this now :)
msg302542 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-09-19 16:30
Backport PR has been created. Once the CI checks are done, we can squash and merge it.
msg302544 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-19 16:37
If PR 3629 was closed by mistake it could be just reopened, isn't?
msg302547 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-09-19 16:52
Serhiy, it can't be re-opened since miss-islington deleted the branch already.
msg302549 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-19 17:42
Ah, now I understand what happened. Thanks Mariatta.
msg302552 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-09-19 17:56
New changeset c6ce8fba07ea6798eac46ab2808167afecd4d90b by Mariatta (Miss Islington (bot)) in branch '3.6': [3.6] bpo-31482: Missing bytes support for random.seed() version 1 (GH-3614) (GH-3659) https://github.com/python/cpython/commit/c6ce8fba07ea6798eac46ab2808167afecd4d90b
msg302647 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-09-20 18:04
Backport was done. Thanks.
History
Date User Action Args
2022-04-11 14:58:52 admin set github: 75663
2017-09-20 18:04:36 Mariatta set status: open -> closedmessages: + stage: patch review -> resolved
2017-09-19 17:56:36 Mariatta set messages: +
2017-09-19 17:42:18 serhiy.storchaka set messages: +
2017-09-19 16:52:56 Mariatta set messages: +
2017-09-19 16:37:16 serhiy.storchaka set messages: +
2017-09-19 16:30:49 Mariatta set messages: +
2017-09-19 16:29:52 python-dev set stage: resolved -> patch reviewpull_requests: + <pull%5Frequest3648>
2017-09-19 16:29:11 Mariatta set messages: +
2017-09-19 16:19:08 serhiy.storchaka set messages: +
2017-09-19 15:58:52 rhettinger set assignee: rhettinger -> Mariattamessages: + nosy: + Mariatta
2017-09-19 10:06:12 serhiy.storchaka set status: closed -> openmessages: +
2017-09-17 16:06:45 rhettinger set status: open -> closedresolution: fixedstage: patch review -> resolved
2017-09-17 16:04:43 python-dev set pull_requests: + <pull%5Frequest3618>
2017-09-17 16:04:32 rhettinger set messages: +
2017-09-16 09:02:38 rhettinger set keywords: + patchstage: patch reviewpull_requests: + <pull%5Frequest3605>
2017-09-15 12:10:39 serhiy.storchaka create