diff options
author | Brett Cannon <brett@python.org> | 2012-03-06 20:33:24 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2012-03-06 20:33:24 (GMT) |
commit | f67e494ca8dfc72c0f812ed46c6a08ad3b9ddc24 (patch) | |
tree | ceed84488164142e5884411566de19f66702c3e7 /Doc/tools/sphinxext/pyspecific.py | |
parent | 0d4d410b2d6891520b1772a85f5ebdf926a0c77e (diff) | |
parent | 0119e4753eec50f671ee716af202b4a1ca28deef (diff) | |
download | cpython-f67e494ca8dfc72c0f812ed46c6a08ad3b9ddc24.zip cpython-f67e494ca8dfc72c0f812ed46c6a08ad3b9ddc24.tar.gz cpython-f67e494ca8dfc72c0f812ed46c6a08ad3b9ddc24.tar.bz2 |
merge
Diffstat (limited to 'Doc/tools/sphinxext/pyspecific.py')
-rw-r--r-- | Doc/tools/sphinxext/pyspecific.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/tools/sphinxext/pyspecific.py b/Doc/tools/sphinxext/pyspecific.py index d928cfd..f359530 100644 --- a/Doc/tools/sphinxext/pyspecific.py +++ b/Doc/tools/sphinxext/pyspecific.py @@ -5,7 +5,7 @@ Sphinx extension with Python doc-specific markup. - :copyright: 2008, 2009, 2010 by Georg Brandl. + :copyright: 2008, 2009, 2010, 2011, 2012 by Georg Brandl. :license: Python license. """ @@ -201,11 +201,12 @@ class PydocTopicsBuilder(Builder): document.append(doctree.ids[labelid]) destination = StringOutput(encoding='utf-8') writer.write(document, destination) - self.topics[label] = str(writer.output) + self.topics[label] = writer.output.encode('utf-8') def finish(self): f = open(path.join(self.outdir, 'topics.py'), 'w') try: + f.write('# -*- coding: utf-8 -*-\n') f.write('# Autogenerated by Sphinx on %s\n' % asctime()) f.write('topics = ' + pformat(self.topics) + '\n') finally: |