[MERGE] Before actually using encoding need to check that Python has corresponding codec (v.4)

John Arbash Meinel john at arbash-meinel.com
Thu Jan 4 16:09:39 GMT 2007


John Arbash Meinel has voted +1 (conditional).
Status is now: Conditionally approved
Comment:
I think you mean "do I need 'voodoo'" here:
+import locale   # XXX: Do I need a woodoo for MacOS?

Though you shouldn't need it, because by that time it has already been 
done. (It is done as part of import bzrlib, because it always calls 
osutils.get_user_encoding())

v- I think this is in osutils.get_terminal_encoding(), so to make it 
more obvious, it would probably be better to say: "Unknown terminal 
encoding:"
+    # check encoding
+    try:
+        codecs.lookup(output_encoding)
+    except LookupError:
+        sys.stderr.write('bzr: warning:'
+                         ' unknown encoding %s.\n'
+                         '  Using encoding %s instead.\n'
+                         % (output_encoding, bzrlib.user_encoding)
+                        )
+        output_encoding = bzrlib.user_encoding
+

Otherwise I think it looks good. I think you can merge it without 
sending a new merge request.

For details, see: 
http://bundlebuggy.aaronbentley.com/request/%3Cenekc0%24n5c%241%40sea.gmane.org%3E



More information about the bazaar mailing list