◐ Shell
clean mode source ↗

Message 72109 - Python tracker

Gregory,
IMHO your patch is better in all aspects.

Regarding my patch, the API wouldn't change at all, as the source reads:
        while len(bytes) < int(n):
            bytes += read(_urandomfd, n - len(bytes))

So "n - len(bytes)" restricts the API to what it was before. But it
would call int() for each loop iteration :/

@Pitrou: My patch still passed the float to read (to keep the current
behavior, warning included), but if doing that can be considered a bug,
let's get rid of the DeprecationWarning by passing an int.