[Pkg-bazaar-commits] ./bzr-git/unstable r42: Make sure to only submit unicode objects to sqlite for pysqlite2.

Jelmer Vernooij jelmer at debian.org
Thu Apr 30 13:10:09 UTC 2009


------------------------------------------------------------
revno: 42
committer: Jelmer Vernooij <jelmer at debian.org>
branch nick: debian
timestamp: Thu 2009-04-30 15:10:09 +0200
message:
  Make sure to only submit unicode objects to sqlite for pysqlite2.
modified:
  shamap.py
-------------- next part --------------
=== modified file 'shamap.py'
--- a/shamap.py	2009-04-16 21:49:42 +0000
+++ b/shamap.py	2009-04-30 13:10:09 +0000
@@ -164,10 +164,14 @@
         trees = []
         blobs = []
         for sha, type, type_data in entries:
+            assert isinstance(type_data[0], str)
+            assert isinstance(type_data[1], str)
+            entry = (sha.decode("utf-8"), type_data[0].decode("utf-8"), 
+                     type_data[1].decode("utf-8"))
             if type == "tree":
-                trees.append((sha, type_data[0], type_data[1]))
+                trees.append(entry)
             elif type == "blob":
-                blobs.append((sha, type_data[0], type_data[1]))
+                blobs.append(entry)
             else:
                 raise AssertionError
         if trees:



More information about the Pkg-bazaar-commits mailing list