tests: avoid implicit bytes -> unicode -> bytes roundtrip on Python 2
authorManuel Jacob <me@manueljacob.de>
Fri, 06 Mar 2020 10:27:38 +0100
changeset 44486 408a4eb41453
parent 44485 9db11679f8ac
child 44487 69ae64637be5
tests: avoid implicit bytes -> unicode -> bytes roundtrip on Python 2 Before the change, there were two implicit conversions: * The format string was converted to unicode because the substituted values were unicode. * When printing the message in log(), the string was converted from unicode to str.
tests/run-tests.py
--- a/tests/run-tests.py	Sun Mar 08 16:40:39 2020 +0100
+++ b/tests/run-tests.py	Fri Mar 06 10:27:38 2020 +0100
@@ -1165,10 +1165,7 @@
         if self._keeptmpdir:
             log(
                 '\nKeeping testtmp dir: %s\nKeeping threadtmp dir: %s'
-                % (
-                    self._testtmp.decode('utf-8'),
-                    self._threadtmp.decode('utf-8'),
-                )
+                % (_bytes2sys(self._testtmp), _bytes2sys(self._threadtmp),)
             )
         else:
             try: