Adapt to Unicode sys.argv
authorW. Trevor King <wking@tremily.us>
Sun, 20 Jan 2013 13:34:13 +0000 (08:34 -0500)
committerW. Trevor King <wking@tremily.us>
Sun, 20 Jan 2013 18:05:18 +0000 (13:05 -0500)
mutt-ldap.py

index d0f674aaf46c1bcfe934d516406b477917d21cae..03f8df90e8bc0c68bc4ac647f6ea8d7c7737997f 100755 (executable)
@@ -177,10 +177,10 @@ if __name__ == '__main__':
     sys.argv = [unicode(arg, argv_encoding) for arg in sys.argv]
 
     if len(sys.argv) < 2:
-        sys.stderr.write('{0}: no search string given\n'.format(sys.argv[0]))
+        sys.stderr.write(u'{0}: no search string given\n'.format(sys.argv[0]))
         sys.exit(1)
 
-    query = unicode(' '.join(sys.argv[1:]), 'utf-8')
+    query = u' '.join(sys.argv[1:])
 
     (cache_hit, addresses) = cache_lookup(query)