aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'g_octave/checksum.py')
-rw-r--r--g_octave/checksum.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/g_octave/checksum.py b/g_octave/checksum.py
index 7a55499..22e47d2 100644
--- a/g_octave/checksum.py
+++ b/g_octave/checksum.py
@@ -24,12 +24,16 @@ import json
import os
from .config import Config
+from .compat import py3k
config = Config()
def sha1_compute(filename):
with open(filename) as fp:
- return sha1(fp.read()).hexdigest()
+ content = fp.read()
+ if py3k:
+ content = bytes(content, 'utf-8')
+ return sha1(content).hexdigest()
def sha1_check(db, p):
description = db[p]