Blame SOURCES/sos-bz1164267-sos-unicode-use-errors-ignore.patch

e75bc7
diff -up sos-3.2/sos/archive.py.orig sos-3.2/sos/archive.py
e75bc7
--- sos-3.2/sos/archive.py.orig	2014-12-17 13:08:57.492362543 +0000
e75bc7
+++ sos-3.2/sos/archive.py	2014-12-17 13:09:22.256522491 +0000
e75bc7
@@ -388,9 +388,9 @@ class TarFileArchive(FileCacheArchive):
e75bc7
                           close_fds=True)
e75bc7
                 stdout, stderr = p.communicate()
e75bc7
                 if stdout:
e75bc7
-                    self.log_info(stdout.decode('utf-8'))
e75bc7
+                    self.log_info(stdout.decode('utf-8', 'ignore'))
e75bc7
                 if stderr:
e75bc7
-                    self.log_error(stderr.decode('utf-8'))
e75bc7
+                    self.log_error(stderr.decode('utf-8', 'ignore'))
e75bc7
                 self._suffix += suffix
e75bc7
                 return self.name()
e75bc7
             except Exception as e:
e75bc7
diff -up sos-3.2/sos/plugins/__init__.py.orig sos-3.2/sos/plugins/__init__.py
e75bc7
--- sos-3.2/sos/plugins/__init__.py.orig	2014-12-17 13:08:57.493362550 +0000
e75bc7
+++ sos-3.2/sos/plugins/__init__.py	2014-12-17 13:09:22.257522498 +0000
e75bc7
@@ -541,7 +541,7 @@ class Plugin(object):
e75bc7
     def add_string_as_file(self, content, filename):
e75bc7
         """Add a string to the archive as a file named `filename`"""
e75bc7
         self.copy_strings.append((content, filename))
e75bc7
-        content = "..." + (content.splitlines()[0]).decode('utf8')
e75bc7
+        content = "..." + (content.splitlines()[0]).decode('utf8', 'ignore')
e75bc7
         self._log_debug("added string '%s' as '%s'" % (content, filename))
e75bc7
 
e75bc7
     def get_cmd_output_now(self, exe, suggest_filename=None,
e75bc7
@@ -610,7 +610,8 @@ class Plugin(object):
e75bc7
 
e75bc7
     def _collect_strings(self):
e75bc7
         for string, file_name in self.copy_strings:
e75bc7
-            content = "..." + (string.splitlines()[0]).decode('utf8')
e75bc7
+            content = "..."
e75bc7
+            content += (string.splitlines()[0]).decode('utf8', 'ignore')
e75bc7
             self._log_info("collecting string '%s' as '%s'"
e75bc7
                            % (content, file_name))
e75bc7
             try:
e75bc7
diff -up sos-3.2/sos/utilities.py.orig sos-3.2/sos/utilities.py
e75bc7
--- sos-3.2/sos/utilities.py.orig	2014-12-17 13:09:16.709486664 +0000
e75bc7
+++ sos-3.2/sos/utilities.py	2014-12-17 13:09:22.257522498 +0000
e75bc7
@@ -140,7 +140,7 @@ def sos_get_command_output(command, time
e75bc7
 
e75bc7
     # shlex.split() reacts badly to unicode on older python runtimes.
e75bc7
     if not six.PY3:
e75bc7
-        command = command.encode('utf-8')
e75bc7
+        command = command.encode('utf-8', 'ignore')
e75bc7
     args = shlex.split(command)
e75bc7
     try:
e75bc7
         p = Popen(args, shell=False, stdout=PIPE, stderr=STDOUT,
e75bc7
@@ -159,7 +159,10 @@ def sos_get_command_output(command, time
e75bc7
     if p.returncode == 126 or p.returncode == 127:
e75bc7
         stdout = six.binary_type(b"")
e75bc7
 
e75bc7
-    return {'status': p.returncode, 'output': stdout.decode('utf-8')}
e75bc7
+    return {
e75bc7
+        'status': p.returncode,
e75bc7
+        'output': stdout.decode('utf-8', 'ignore')
e75bc7
+    }
e75bc7
 
e75bc7
 
e75bc7
 def import_module(module_fqname, superclasses=None):