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. * #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) * #4070, #4111: crashes when the warning message contains format strings (again)
* #4108: Search word highlighting breaks SVG images * #4108: Search word highlighting breaks SVG images
* #3692: Unable to build HTML if writing .buildinfo failed
Testing Testing
-------- --------

View File

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