1. mbrochh
  2. sphinx

Commits

Roland Meister  committed 2649878

Fix UnicodeError for unicode filenames while writing the zipfile.

  • Participants
  • Parent commits 5e0de27
  • Branches default

Comments (0)

Files changed (1)

File sphinx/builders/epub.py

View file
     <meta name="cover" content="%(cover)s"/>
 '''
 
-_coverpage_name = 'epub-cover.html'
+_coverpage_name = u'epub-cover.html'
 
 _file_template = u'''\
     <item id="%(id)s"
         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)
         epub.close()