Commits

Anonymous committed 2649878

Fix UnicodeError for unicode filenames while writing the zipfile.

Comments (0)

Files changed (1)

sphinx/builders/epub.py

     <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()