Merge pull request #6148 from lsaffre/1.8

Fixed a bug in intersphinx failure reporting
This commit is contained in:
Takeshi KOMIYA 2019-03-08 22:12:36 +09:00 committed by GitHub
commit e8294ccd41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -183,7 +183,7 @@ def fetch_inventory(app, uri, inv):
f = open(path.join(app.srcdir, inv), 'rb') f = open(path.join(app.srcdir, inv), 'rb')
except Exception as err: except Exception as err:
err.args = ('intersphinx inventory %r not fetchable due to %s: %s', err.args = ('intersphinx inventory %r not fetchable due to %s: %s',
inv, err.__class__, err) inv, err.__class__, str(err))
raise raise
try: try:
if hasattr(f, 'url'): if hasattr(f, 'url'):
@ -201,7 +201,7 @@ def fetch_inventory(app, uri, inv):
raise ValueError('unknown or unsupported inventory version: %r' % exc) raise ValueError('unknown or unsupported inventory version: %r' % exc)
except Exception as err: except Exception as err:
err.args = ('intersphinx inventory %r not readable due to %s: %s', err.args = ('intersphinx inventory %r not readable due to %s: %s',
inv, err.__class__.__name__, err) inv, err.__class__.__name__, str(err))
raise raise
else: else:
return invdata return invdata
@ -265,10 +265,9 @@ def load_mappings(app):
for fail in failures: for fail in failures:
logger.info(*fail) logger.info(*fail)
else: else:
issues = '\n'.join([f[0] % f[1:] for f in failures])
logger.warning(__("failed to reach any of the inventories " logger.warning(__("failed to reach any of the inventories "
"with the following issues:")) "with the following issues:") + "\n" + issues)
for fail in failures:
logger.warning(*fail)
if update: if update:
inventories.clear() inventories.clear()