summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Holth <dholth@fastmail.fm>2013-08-22 14:11:07 -0400
committerDaniel Holth <dholth@fastmail.fm>2013-08-22 14:11:07 -0400
commitafdf4159a5c94088424f613512fed0181e855235 (patch)
tree3b4dd1c340cfad58d0e9181c2685fdb2aaa32628
parent6a961ea10aca5af1a2fc770b41ab7a6bd324afe6 (diff)
parent2acca7af7c7083682643cb90c76fe6fce044b02a (diff)
downloadwheel-afdf4159a5c94088424f613512fed0181e855235.tar.gz
Merged in kostialopuhin/wheel/fix-too-many-open-files (pull request #26)
fix "Too many open files" error when running under PyPy
-rw-r--r--wheel/bdist_wheel.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/wheel/bdist_wheel.py b/wheel/bdist_wheel.py
index db6e338..77d1752 100644
--- a/wheel/bdist_wheel.py
+++ b/wheel/bdist_wheel.py
@@ -432,7 +432,8 @@ class bdist_wheel(Command):
hash = ''
size = ''
else:
- data = open(path, 'rb').read()
+ with open(path, 'rb') as f:
+ data = f.read()
digest = hashlib.sha256(data).digest()
hash = 'sha256=' + native(urlsafe_b64encode(digest))
size = len(data)