mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #844: Fix crashes when dealing with Unicode output in doctest extension.
This commit is contained in:
parent
03152f8b60
commit
0c316f22eb
2
CHANGES
2
CHANGES
@ -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!
|
||||
======================================================================
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user