Rev 44: Replace undecodable and unencodable characters in search output. in http://people.ubuntu.com/~robertc/baz2.0/plugins/search/trunk

Robert Collins robertc at robertcollins.net
Sat Jun 28 08:22:11 BST 2008


At http://people.ubuntu.com/~robertc/baz2.0/plugins/search/trunk

------------------------------------------------------------
revno: 44
revision-id: robertc at robertcollins.net-20080628072210-f0je2oqv8j8qqcrd
parent: robertc at robertcollins.net-20080622100438-raipn9bo8wq9sezf
committer: Robert Collins <robertc at robertcollins.net>
branch nick: trunk
timestamp: Sat 2008-06-28 17:22:10 +1000
message:
  Replace undecodable and unencodable characters in search output.
modified:
  commands.py                    commands.py-20080608052041-z5bahsl8kwl0uf4x-5
  index.py                       index.py-20080608055509-hnimeek7q8tctkqf-2
=== modified file 'commands.py'
--- a/commands.py	2008-06-17 12:25:37 +0000
+++ b/commands.py	2008-06-28 07:22:10 +0000
@@ -48,6 +48,7 @@
     console.
     """
 
+    encoding_type = 'replace'
     _see_also = ['index']
     takes_options = [Option('suggest', short_name='s',
         help="Suggest possible terms to complete the search.")

=== modified file 'index.py'
--- a/index.py	2008-06-22 10:04:38 +0000
+++ b/index.py	2008-06-28 07:22:10 +0000
@@ -739,7 +739,7 @@
         for line in lines:
             line_terms = set(_tokeniser_re.split(line))
             if len(line_terms.intersection(flattened_terms)) > 0:
-                return line[:-1]
+                return line[:-1].decode('utf8', 'replace')
         raise ValueError("no match? wtf? %r" % lines)
 
 




More information about the bazaar-commits mailing list