From e27b9cfe05925b28547b6e5f4facc1891713a3a9 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 26 Jun 2015 21:11:47 +0300 Subject: [PATCH] os: Fix urandom() to use right open() function. Thanks to @dpgeorge for report. --- os/os/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/os/os/__init__.py b/os/os/__init__.py index af5f61e7..1f57cf0a 100644 --- a/os/os/__init__.py +++ b/os/os/__init__.py @@ -223,5 +223,6 @@ def fsdecode(s): def urandom(n): - with open("/dev/urandom", "rb") as f: + import builtins + with builtins.open("/dev/urandom", "rb") as f: return f.read(n)