Commits

Georg Brandl committed 51347d4

Fix encoding handling of the pydoc-topics writer.

  • Participants
  • Parent commits 2822765

Comments (0)

Files changed (1)

File Doc/tools/sphinxext/pyspecific.py

 
     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.
 """
 
             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: