aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2011-01-09 10:51:46 -0500
committerWaylan Limberg <waylan@gmail.com>2011-01-09 10:51:46 -0500
commit682733393476e1faef2a06b373af042c1bf8259c (patch)
tree47f528c53b024f68c3d772f001516df3ebe266a7
parent8edb47a02c50edbfa7092ed3667aaf7f070694af (diff)
parent3b2820f23ea5088afbb1c76b9831e311a0b5bcd3 (diff)
downloadmarkdown-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
-rwxr-xr-xsetup.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index 67591c6..5f00c0d 100755
--- a/setup.py
+++ b/setup.py
@@ -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()