diff options
author | Waylan Limberg <waylan@gmail.com> | 2011-01-09 10:51:46 -0500 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2011-01-09 10:51:46 -0500 |
commit | 682733393476e1faef2a06b373af042c1bf8259c (patch) | |
tree | 47f528c53b024f68c3d772f001516df3ebe266a7 /setup.py | |
parent | 8edb47a02c50edbfa7092ed3667aaf7f070694af (diff) | |
parent | 3b2820f23ea5088afbb1c76b9831e311a0b5bcd3 (diff) | |
download | markdown-682733393476e1faef2a06b373af042c1bf8259c.tar.gz markdown-682733393476e1faef2a06b373af042c1bf8259c.tar.bz2 markdown-682733393476e1faef2a06b373af042c1bf8259c.zip |
Merge commit 'refs/merge-requests/9' of git://gitorious.org/python-markdown/mainline into int
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -116,6 +116,10 @@ class build_docs(Command): return 'Python Markdown' def run(self): + # Before importing markdown, we have to tweak sys.path because we have to import it from + # the build directory (we might have ran 2to3 on the library) + bld_cmd = self.get_finalized_command("build") + sys.path.insert(0, bld_cmd.build_lib) try: import markdown except ImportError: @@ -134,12 +138,12 @@ class build_docs(Command): if self.verbose: print ('Converting %s -> %s' % (infile, outfile)) if not self.dry_run: - doc = open(outfile, 'w') - doc.write(doc_header % {'title': title, - 'menu': menu}) + doc = open(outfile, 'wb') + header = doc_header % {'title': title, 'menu': menu} + doc.write(header.encode('utf-8')) md.convertFile(infile, doc) md.reset() - doc.write(doc_footer) + doc.write(doc_footer.encode('utf-8')) doc.close() |