diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2010-12-09 23:22:27 -0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2010-12-09 23:22:27 -0200 |
commit | d0c6e156e471287ae0aa33150b01bba60362db57 (patch) | |
tree | b53b7b8b9e58412356ab6b954010e912afb1c497 /g_octave/checksum.py | |
parent | small fixes on the log class and some minor typos (diff) | |
download | g-octave-d0c6e156e471287ae0aa33150b01bba60362db57.tar.gz g-octave-d0c6e156e471287ae0aa33150b01bba60362db57.tar.bz2 g-octave-d0c6e156e471287ae0aa33150b01bba60362db57.zip |
fixed a bunch of tests
Diffstat (limited to 'g_octave/checksum.py')
-rw-r--r-- | g_octave/checksum.py | 6 |
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] |