mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #5175 from tk0miya/5161_html_crashes_on_copying
Fix html: crashes if copying static files are failed (refs: #5161)
This commit is contained in:
commit
c777b920c3
1
CHANGES
1
CHANGES
@ -44,6 +44,7 @@ Bugs fixed
|
|||||||
sorting
|
sorting
|
||||||
* #5139: autodoc: Enum argument missing if it shares value with another
|
* #5139: autodoc: Enum argument missing if it shares value with another
|
||||||
* #4946: py domain: rtype field could not handle "None" as a type
|
* #4946: py domain: rtype field could not handle "None" as a type
|
||||||
|
* #5161: html: crashes if copying static files are failed
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
@ -740,12 +740,13 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
try:
|
try:
|
||||||
copyfile(path.join(self.srcdir, src),
|
copyfile(path.join(self.srcdir, src),
|
||||||
path.join(self.outdir, '_downloads', dest))
|
path.join(self.outdir, '_downloads', dest))
|
||||||
except Exception as err:
|
except EnvironmentError as err:
|
||||||
logger.warning('cannot copy downloadable file %r: %s',
|
logger.warning('cannot copy downloadable file %r: %s',
|
||||||
path.join(self.srcdir, src), err)
|
path.join(self.srcdir, src), err)
|
||||||
|
|
||||||
def copy_static_files(self):
|
def copy_static_files(self):
|
||||||
# type: () -> None
|
# type: () -> None
|
||||||
|
try:
|
||||||
# copy static files
|
# copy static files
|
||||||
logger.info(bold('copying static files... '), nonl=True)
|
logger.info(bold('copying static files... '), nonl=True)
|
||||||
ensuredir(path.join(self.outdir, '_static'))
|
ensuredir(path.join(self.outdir, '_static'))
|
||||||
@ -804,9 +805,14 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
copyfile(path.join(self.confdir, self.config.html_favicon),
|
copyfile(path.join(self.confdir, self.config.html_favicon),
|
||||||
icontarget)
|
icontarget)
|
||||||
logger.info('done')
|
logger.info('done')
|
||||||
|
except EnvironmentError as err:
|
||||||
|
# TODO: In py3, EnvironmentError (and IOError) was merged into OSError.
|
||||||
|
# So it should be replaced by IOError on dropping py2 support
|
||||||
|
logger.warning(__('cannot copy static file %r'), err)
|
||||||
|
|
||||||
def copy_extra_files(self):
|
def copy_extra_files(self):
|
||||||
# type: () -> None
|
# type: () -> None
|
||||||
|
try:
|
||||||
# copy html_extra_path files
|
# copy html_extra_path files
|
||||||
logger.info(bold('copying extra files... '), nonl=True)
|
logger.info(bold('copying extra files... '), nonl=True)
|
||||||
excluded = Matcher(self.config.exclude_patterns)
|
excluded = Matcher(self.config.exclude_patterns)
|
||||||
@ -819,6 +825,8 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
|
|
||||||
copy_asset(entry, self.outdir, excluded)
|
copy_asset(entry, self.outdir, excluded)
|
||||||
logger.info('done')
|
logger.info('done')
|
||||||
|
except EnvironmentError as err:
|
||||||
|
logger.warning(__('cannot copy extra file %r'), err)
|
||||||
|
|
||||||
def write_buildinfo(self):
|
def write_buildinfo(self):
|
||||||
# type: () -> None
|
# type: () -> None
|
||||||
|
Loading…
Reference in New Issue
Block a user