Index: Misc/NEWS =================================================================== --- Misc/NEWS (revision 78337) +++ Misc/NEWS (working copy) @@ -21,6 +21,9 @@ Library ------- +- Issue #1708316: doctest fix: set the .encoding attribute on the object + that doctest uses to replace sys.stdout. + - Issue #7970: email.Generator.flatten now correctly flattens message/rfc822 messages parsed by email.Parser.HeaderParser. Index: Lib/doctest.py =================================================================== --- Lib/doctest.py (revision 78337) +++ Lib/doctest.py (working copy) @@ -1120,6 +1120,7 @@ # Create a fake output target for capturing doctest output. self._fakeout = _SpoofOut() + self._fakeout.encoding = sys.__stdout__.encoding #///////////////////////////////////////////////////////////////// # Reporting methods