[issue44260] _Random.seed() is called twice

2021-05-31 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 ___ Python tracker ___

[issue44260] _Random.seed() is called twice

2021-05-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset a6a20658814e8668966fc86de0e80a4772864781 by Serhiy Storchaka in branch 'main': bpo-44260: Do not read system entropy without need in Random() (GH-26455) https://github.com/python/cpython/commit/a6a20658814e8668966fc86de0e80a4772864781

[issue44260] _Random.seed() is called twice

2021-05-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +25051 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26455 ___ Python tracker

[issue44260] _Random.seed() is called twice

2021-05-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Consider moving seeding from _random.Random.__new__ to _random.Random.__init__. Since random.Random.__init__ doesn't call the super(), the C version never gets called, avoiding the double seeding. But, it still lets _random.Random function as a

[issue44260] _Random.seed() is called twice

2021-05-28 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : _Random.seed() is called twice: first it is called in _Random.__new__(), then it is called in Random.__init__(). By default it reads system enthropy, so it consumes global system resource without need. -- components: Extension Modules messages: