httpbin icon indicating copy to clipboard operation
httpbin copied to clipboard

bytes endpoint with seed not stable between python 2 and python 3

Open rajsite opened this issue 6 years ago • 0 comments

I'm upgrading a build environment from python 2 to python 3 and noticed that endpoints with seeded random numbers are not returning the same values. It seems to be related to usage of randint: https://github.com/postmanlabs/httpbin/blob/f8ec666b4d1b654e4ff6aedd356f510dcac09f83/httpbin/core.py#L1448

It seems like randint is not seed safe and it looks like only random() is: https://bugs.python.org/issue27742#msg272544

Ubuntu 16.04.6 LTS python 2.7.12 -> python 3.5.6

rajsite avatar Feb 11 '20 21:02 rajsite