diff options
| author | Georg Brandl <georg@python.org> | 2012-01-29 11:58:23 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2012-01-29 11:58:23 +0100 |
| commit | cbd1440204de43f43e9e769a3090139cce6c4d1f (patch) | |
| tree | 9961e1ee5f27bf06ce87995c732198cbec470cf5 | |
| parent | 1eea117865ad4f32e2f4a815b6c99f8cbe8eac2a (diff) | |
| download | sphinx-cbd1440204de43f43e9e769a3090139cce6c4d1f.tar.gz | |
Closes #844: Fix crashes when dealing with Unicode output in doctest extension.
| -rw-r--r-- | CHANGES | 2 | ||||
| -rw-r--r-- | sphinx/ext/doctest.py | 4 |
2 files changed, 6 insertions, 0 deletions
@@ -38,6 +38,8 @@ Release 1.1.3 (in development) * #834: Fix HTML help language/encoding mapping for all Sphinx supported languages. +* #844: Fix crashes when dealing with Unicode output in doctest extension. + Release 1.1.2 (Nov 1, 2011) -- 1.1.1 is a silly version number anyway! ====================================================================== diff --git a/sphinx/ext/doctest.py b/sphinx/ext/doctest.py index 3e329826..717848ea 100644 --- a/sphinx/ext/doctest.py +++ b/sphinx/ext/doctest.py @@ -23,9 +23,11 @@ from docutils import nodes from docutils.parsers.rst import directives from sphinx.builders import Builder +from sphinx.util import force_decode from sphinx.util.nodes import set_source_info from sphinx.util.compat import Directive from sphinx.util.console import bold +from sphinx.util.pycompat import bytes blankline_re = re.compile(r'^\s*<BLANKLINE>', re.MULTILINE) doctestopt_re = re.compile(r'#\s*doctest:.+$', re.MULTILINE) @@ -231,6 +233,8 @@ Results of doctest builder run on %s self.info(text, nonl=True) if self.app.quiet: self.warn(text) + if isinstance(text, bytes): + text = force_decode(text, None) self.outfile.write(text) def get_target_uri(self, docname, typ=None): |
