mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
* importing the pull request #270 change to stable: Non-ASCII docstring cause UnicodeDecodeError when uses with inheritance-diagram directive. Thanks to WAKAYAMA shirou. Closes #1533
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -34,6 +34,8 @@ Bugs fixed
|
|||||||
texinfo and changes.
|
texinfo and changes.
|
||||||
* #1531: On Python3 environment, docutils.conf with 'source_link=true' in the
|
* #1531: On Python3 environment, docutils.conf with 'source_link=true' in the
|
||||||
general section cause type error.
|
general section cause type error.
|
||||||
|
* PR#270, #1533: Non-ASCII docstring cause UnicodeDecodeError when uses with
|
||||||
|
inheritance-diagram directive. Thanks to WAKAYAMA shirou.
|
||||||
|
|
||||||
Release 1.2.2 (released Mar 2, 2014)
|
Release 1.2.2 (released Mar 2, 2014)
|
||||||
====================================
|
====================================
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ from docutils.parsers.rst import directives
|
|||||||
|
|
||||||
from sphinx.ext.graphviz import render_dot_html, render_dot_latex, \
|
from sphinx.ext.graphviz import render_dot_html, render_dot_latex, \
|
||||||
render_dot_texinfo
|
render_dot_texinfo
|
||||||
|
from sphinx.pycode import ModuleAnalyzer
|
||||||
from sphinx.util.compat import Directive
|
from sphinx.util.compat import Directive
|
||||||
|
|
||||||
|
|
||||||
@@ -158,7 +159,9 @@ class InheritanceGraph(object):
|
|||||||
tooltip = None
|
tooltip = None
|
||||||
try:
|
try:
|
||||||
if cls.__doc__:
|
if cls.__doc__:
|
||||||
|
enc = ModuleAnalyzer.for_module(cls.__module__).encoding
|
||||||
doc = cls.__doc__.strip().split("\n")[0]
|
doc = cls.__doc__.strip().split("\n")[0]
|
||||||
|
doc = doc.decode(enc)
|
||||||
if doc:
|
if doc:
|
||||||
tooltip = '"%s"' % doc.replace('"', '\\"')
|
tooltip = '"%s"' % doc.replace('"', '\\"')
|
||||||
except Exception: # might raise AttributeError for strange classes
|
except Exception: # might raise AttributeError for strange classes
|
||||||
|
|||||||
Reference in New Issue
Block a user