From 063d4d88f7730343bfc05d936352bfda379f4b39 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 5 Jun 2008 17:06:34 +0000 Subject: [PATCH] #3041: fix handling of unicode docstrings. --- CHANGES | 2 ++ sphinx/ext/autodoc.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index bebbd818c..42e3b77e8 100644 --- a/CHANGES +++ b/CHANGES @@ -69,6 +69,8 @@ Bugs fixed * Fix the handling of explicit module names given to autoclass directives. They now show up with the correct module name in the generated docs. +* Enable autodoc to process Unicode docstrings. + Release 0.3 (May 6, 2008) ========================= diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 36d6a32ca..b68285846 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -218,7 +218,7 @@ def generate_rst(what, name, members, inherited, undoc, add_content, document, module = getattr(todoc, '__module__', None) if module is not None: charset = get_module_charset(module) - docstrings = [docstring.decode(charset) for docstring in docstrings] + docstrings = [isinstance(d, str) and d.decode(charset) or d for d in docstrings] # add docstring content for docstring in docstrings: