← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3-fix-doctest-output into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3-fix-doctest-output into launchpad:master.

Commit message:
Adjust fix_doctest_output to coerce to str, not bytes

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/391087

doctest._SpoofOut writes to a StringIO.StringIO on Python 2, but an io.StringIO on Python 3.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-fix-doctest-output into launchpad:master.
diff --git a/lib/lp/scripts/utilities/test.py b/lib/lp/scripts/utilities/test.py
index 167d5c4..e1e67b8 100755
--- a/lib/lp/scripts/utilities/test.py
+++ b/lib/lp/scripts/utilities/test.py
@@ -44,7 +44,7 @@ def fix_doctest_output():
     class _SpoofOut(doctest._SpoofOut):
 
         def write(self, value):
-            _RealSpoofOut.write(self, six.ensure_binary(value))
+            _RealSpoofOut.write(self, six.ensure_str(value))
 
     doctest._SpoofOut = _SpoofOut