From 936d538eba99a15122e45423a534b776dadb1bc7 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sat, 5 Jan 2013 10:09:15 +0100 Subject: [PATCH] correctly open / close file when computing hash --- src/common/jingle_ft.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/jingle_ft.py b/src/common/jingle_ft.py index c7636d3d1..652ffd990 100644 --- a/src/common/jingle_ft.py +++ b/src/common/jingle_ft.py @@ -149,12 +149,13 @@ class JingleFileTransfer(JingleContent): if self.file_props.algo == None: return try: - file_ = open(self.file_props.file_name, 'r') + file_ = open(self.file_props.file_name, 'rb') except: # can't open file return h = nbxmpp.Hashes() hash_ = h.calculateHash(self.file_props.algo, file_) + file_.close() # DEBUG #hash_ = '1294809248109223' if not hash_: