summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Lopuhin <kostia.lopuhin@gmail.com>2013-08-22 21:52:05 +0400
committerKonstantin Lopuhin <kostia.lopuhin@gmail.com>2013-08-22 21:52:05 +0400
commit2acca7af7c7083682643cb90c76fe6fce044b02a (patch)
tree3b4dd1c340cfad58d0e9181c2685fdb2aaa32628
parent6a961ea10aca5af1a2fc770b41ab7a6bd324afe6 (diff)
downloadwheel-fix-too-many-open-files.tar.gz
fix "Too many open files" error when running under PyPyfix-too-many-open-files
-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)