mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #5320: intersphinx: crashed if invalid url given
This commit is contained in:
parent
2371614227
commit
bde53bf9fb
2
CHANGES
2
CHANGES
@ -16,6 +16,8 @@ Features added
|
|||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
* #5320: intersphinx: crashed if invalid url given
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@ -403,14 +403,19 @@ def inspect_main(argv):
|
|||||||
def warn(self, msg):
|
def warn(self, msg):
|
||||||
print(msg, file=sys.stderr)
|
print(msg, file=sys.stderr)
|
||||||
|
|
||||||
filename = argv[0]
|
try:
|
||||||
invdata = fetch_inventory(MockApp(), '', filename) # type: ignore
|
filename = argv[0]
|
||||||
for key in sorted(invdata or {}):
|
invdata = fetch_inventory(MockApp(), '', filename) # type: ignore
|
||||||
print(key)
|
for key in sorted(invdata or {}):
|
||||||
for entry, einfo in sorted(invdata[key].items()):
|
print(key)
|
||||||
print('\t%-40s %s%s' % (entry,
|
for entry, einfo in sorted(invdata[key].items()):
|
||||||
einfo[3] != '-' and '%-40s: ' % einfo[3] or '',
|
print('\t%-40s %s%s' % (entry,
|
||||||
einfo[2]))
|
einfo[3] != '-' and '%-40s: ' % einfo[3] or '',
|
||||||
|
einfo[2]))
|
||||||
|
except ValueError as exc:
|
||||||
|
print(exc.args[0] % exc.args[1:])
|
||||||
|
except Exception as exc:
|
||||||
|
print('Unknown error: %r' % exc)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user