merge with stable

This commit is contained in:
Takayuki Shimizukawa 2014-08-15 22:47:00 +09:00
commit 544e73602c
2 changed files with 6 additions and 1 deletions

View File

@ -235,6 +235,8 @@ Bugs fixed
texinfo and changes.
* #1531: On Python3 environment, docutils.conf with 'source_link=true' in the
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)
====================================

View File

@ -45,12 +45,14 @@ try:
except ImportError:
from md5 import md5
from six import text_type
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx.ext.graphviz import render_dot_html, render_dot_latex, \
render_dot_texinfo
from sphinx.pycode import ModuleAnalyzer
from sphinx.util import force_decode
from sphinx.util.compat import Directive
@ -161,7 +163,8 @@ class InheritanceGraph(object):
if cls.__doc__:
enc = ModuleAnalyzer.for_module(cls.__module__).encoding
doc = cls.__doc__.strip().split("\n")[0]
doc = doc.decode(enc)
if not isinstance(doc, text_type):
doc = force_decode(doc, enc)
if doc:
tooltip = '"%s"' % doc.replace('"', '\\"')
except Exception: # might raise AttributeError for strange classes