1. Daniel Neuhäuser
  2. sphinx-logbook

Commits

DasIch  committed 79ecde1

Fix file path handling in the epub builder

  • Participants
  • Parent commits 47630de
  • Branches default

Comments (0)

Files changed (1)

File sphinx/builders/epub.py

View file
  • Ignore whitespace
 
 import os
 import re
+import sys
 import time
 import codecs
 import zipfile
         epub.write(path.join(outdir, 'mimetype'), 'mimetype', \
             zipfile.ZIP_STORED)
         for file in projectfiles:
-            if isinstance(file, unicode):
-                file = file.encode('utf-8')
-            epub.write(path.join(outdir, file), file, zipfile.ZIP_DEFLATED)
+            fp = path.join(outdir, file)
+            if isinstance(fp, unicode):
+                fp = fp.encode(sys.getfilesystemencoding())
+            epub.write(fp, file, zipfile.ZIP_DEFLATED)
         epub.close()