Stop setting utf-8 in decode/encode calls 22/67922/2
authorCédric Ollivier <cedric.ollivier@orange.com>
Sun, 12 May 2019 10:23:30 +0000 (12:23 +0200)
committerCédric Ollivier <ollivier.cedric@gmail.com>
Thu, 23 May 2019 19:01:33 +0000 (21:01 +0200)
It's the default value.

Change-Id: I301f750cabc41a1564a700ae8d7328f195a4ae9b
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit 0d308f4db3434ae6f8147f0f452e5c542429e636)

xtesting/core/feature.py
xtesting/core/unit.py

index f28e720..6d5d741 100644 (file)
@@ -113,8 +113,8 @@ class BashFeature(Feature):
                     stderr=subprocess.STDOUT)
                 for line in iter(process.stdout.readline, b''):
                     if console:
-                        sys.stdout.write(line.decode("utf-8"))
-                    f_stdout.write(line.decode("utf-8"))
+                        sys.stdout.write(line.decode())
+                    f_stdout.write(line.decode())
                 process.wait()
             with open(self.result_file, 'r') as f_stdin:
                 self.__logger.debug("$ %s\n%s", cmd, f_stdin.read().rstrip())
index 774411a..8e603ce 100644 (file)
@@ -48,7 +48,7 @@ class Suite(testcase.TestCase):
         stats = subprocess.Popen(
             ['subunit-stats'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
         output, _ = stats.communicate(stream.read())
-        cls.__logger.info("\n\n%s", output.decode("utf-8"))
+        cls.__logger.info("\n\n%s", output.decode())
 
     def generate_xunit(self, stream):
         """Generate junit report from subunit stream
@@ -62,7 +62,7 @@ class Suite(testcase.TestCase):
                 ['subunit2junitxml'], stdin=subprocess.PIPE,
                 stdout=subprocess.PIPE)
             output, _ = stats.communicate(stream.read())
-            xml.write(output.decode("utf-8"))
+            xml.write(output.decode())
 
     def generate_html(self, stream):
         """Generate html report from subunit stream