mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix UnicodeError for unicode filenames while writing the zipfile.
This commit is contained in:
parent
e2bec6a8bf
commit
3b42bf8c27
@ -101,7 +101,7 @@ _cover_template = u'''\
|
||||
<meta name="cover" content="%(cover)s"/>
|
||||
'''
|
||||
|
||||
_coverpage_name = 'epub-cover.html'
|
||||
_coverpage_name = u'epub-cover.html'
|
||||
|
||||
_file_template = u'''\
|
||||
<item id="%(id)s"
|
||||
@ -540,5 +540,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user