summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-01-26 22:44:38 +0100
committerGeorg Brandl <georg@python.org>2009-01-26 22:44:38 +0100
commitd1e61194619376a95c417edc22b86acf4a3e585b (patch)
tree14f6bc260a2777e651ce7abb59c6ab5f76684dac /sphinx/ext/autodoc.py
parent55c4f5a096f4c7619180098dec95ff6cefb51e11 (diff)
parent257d630c6d4a4a6a9f5212b156504d6a77178c60 (diff)
downloadsphinx-git-d1e61194619376a95c417edc22b86acf4a3e585b.tar.gz
merge with trunk
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r--sphinx/ext/autodoc.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index c005e36a9..87d876cd8 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -458,7 +458,10 @@ class RstGenerator(object):
# add content from attribute documentation
if analyzer:
- sourcename = '%s:docstring of %s' % (analyzer.srcname, fullname)
+ # prevent encoding errors when the file name is non-ASCII
+ srcname = unicode(analyzer.srcname,
+ sys.getfilesystemencoding(), 'replace')
+ sourcename = u'%s:docstring of %s' % (srcname, fullname)
attr_docs = analyzer.find_attr_docs()
if what in ('data', 'attribute'):
key = ('.'.join(objpath[:-1]), objpath[-1])
@@ -469,7 +472,7 @@ class RstGenerator(object):
fullname, todoc)):
self.result.append(indent + line, sourcename, i)
else:
- sourcename = 'docstring of %s' % fullname
+ sourcename = u'docstring of %s' % fullname
attr_docs = {}
# add content from docstrings