From e258596fbb3ed2d861cd7af7f9d59de5061f46f6 Mon Sep 17 00:00:00 2001 From: Ben Carrillo Date: Tue, 12 Feb 2013 05:16:41 +0900 Subject: patch unicode and failing tests on chroot --- debian/patches/fix-unicodeencode-error | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 debian/patches/fix-unicodeencode-error (limited to 'debian/patches/fix-unicodeencode-error') diff --git a/debian/patches/fix-unicodeencode-error b/debian/patches/fix-unicodeencode-error deleted file mode 100644 index 821ceb9..0000000 --- a/debian/patches/fix-unicodeencode-error +++ /dev/null @@ -1,19 +0,0 @@ -Description: fix for _format arg function raising UnicodeDecodeError if DEFAULT_ENCODING cannot encode unicode characters -Author: Ben Carrillo -Bug: XXX -Forwarded: yes ---- a/sh.py -+++ b/sh.py -@@ -561,7 +561,11 @@ - # if the argument is already unicode, or a number or whatever, - # this first call will fail. - try: arg = unicode(arg, DEFAULT_ENCODING).encode(DEFAULT_ENCODING) -- except TypeError: arg = unicode(arg).encode(DEFAULT_ENCODING) -+ except TypeError: -+ try: -+ arg = unicode(arg).encode(DEFAULT_ENCODING) -+ except UnicodeEncodeError: -+ arg = unicode(arg).encode('utf-8') - return arg - - -- cgit v1.2.3