Author miguendes
Recipients arjaz, mark.dickinson, miguendes, rhettinger
Date 2021-05-03.10:20:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1620037229.44.0.0196799679551.issue44018@roundup.psfhosted.org>
In-reply-to
Content
The problem is that random seed will do

```
            if isinstance(a, str):
                a = a.encode()
            a += _sha512(a).digest()
            a = int.from_bytes(a, 'big')
```

and that will modify the bytearray in place.

>>> a = bytearray("1234", "utf-8")
>>> a += b"digest"
>>> a
bytearray(b'1234digest')


IMHO, seed shouldn't modify the input. Since str, and bytes are immutable that will only happen when passing a bytearray which is not consistent.
History
Date User Action Args
2021-05-03 10:20:29miguendessetrecipients: + miguendes, rhettinger, mark.dickinson, arjaz
2021-05-03 10:20:29miguendessetmessageid: <1620037229.44.0.0196799679551.issue44018@roundup.psfhosted.org>
2021-05-03 10:20:29miguendeslinkissue44018 messages
2021-05-03 10:20:29miguendescreate