Fix #3692: Unable to build HTML if writing .buildinfo failed

This commit is contained in:
Takeshi KOMIYA 2017-10-07 23:37:33 +09:00
parent 8486f106b0
commit 46bf9ab4a0
2 changed files with 10 additions and 6 deletions

View File

@ -25,6 +25,7 @@ Bugs fixed
* #4096: C++, don't crash when using the wrong role type. Thanks to mitya57.
* #4070, #4111: crashes when the warning message contains format strings (again)
* #4108: Search word highlighting breaks SVG images
* #3692: Unable to build HTML if writing .buildinfo failed
Testing
--------

View File

@ -776,12 +776,15 @@ class StandaloneHTMLBuilder(Builder):
def write_buildinfo(self):
# type: () -> None
# write build info file
try:
with open(path.join(self.outdir, '.buildinfo'), 'w') as fp:
fp.write('# Sphinx build info version 1\n'
'# This file hashes the configuration used when building'
' these files. When it is not found, a full rebuild will'
' be done.\nconfig: %s\ntags: %s\n' %
(self.config_hash, self.tags_hash))
except IOError as exc:
logger.warning('Failed to write build info file: %r', exc)
def cleanup(self):
# type: () -> None