summaryrefslogtreecommitdiffstats
path: root/Lib/packaging/command/install_distinfo.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/packaging/command/install_distinfo.py')
-rw-r--r--Lib/packaging/command/install_distinfo.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/packaging/command/install_distinfo.py b/Lib/packaging/command/install_distinfo.py
index 41fe734..a25a15a 100644
--- a/Lib/packaging/command/install_distinfo.py
+++ b/Lib/packaging/command/install_distinfo.py
@@ -133,9 +133,9 @@ class install_distinfo(Command):
writer.writerow((fpath, '', ''))
else:
size = os.path.getsize(fpath)
- with open(fpath, 'r') as fp:
+ with open(fpath, 'rb') as fp:
hash = hashlib.md5()
- hash.update(fp.read().encode())
+ hash.update(fp.read())
md5sum = hash.hexdigest()
writer.writerow((fpath, md5sum, size))