42d8ca01a203 — jakob krainz 11 years ago
bugfix
1 files changed, 5 insertions(+), 2 deletions(-)

M src/b.py
M src/b.py +5 -2
@@ 137,7 137,10 @@ def _hash(text):
     Currently SHA1 hashing is used.  It should be plenty for our purposes.
     
     """
-    return hashlib.sha1(text.encode('utf-8')).hexdigest()
+    try:
+        return hashlib.sha1(text.encode('utf-8')).hexdigest()
+    except UnicodeDecodeError as e:
+        return hashlib.sha1(text).hexdigest()
 
 def _mkdir_p(path):
     """ race condition handling recursive mkdir -p call

          
@@ 892,4 895,4 @@ def status(ui,repo,revision='tip',ignore
                 ret.append(file)
     ui.write(ret if bug_change else None)
     ui.write('\n')
-    
  No newline at end of file
+