mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '1.7' into 5322_Any_causes_crashed
This commit is contained in:
commit
8b6a12d5d6
2
CHANGES
2
CHANGES
@ -16,6 +16,8 @@ Features added
|
||||
Bugs fixed
|
||||
----------
|
||||
|
||||
* #5320: intersphinx: crashed if invalid url given
|
||||
* #5326: manpage: crashed when invalid docname is specified as ``man_pages``
|
||||
* #5322: autodoc: ``Any`` typehint causes formatting error
|
||||
|
||||
Testing
|
||||
|
@ -18,6 +18,7 @@ from six import string_types
|
||||
from sphinx import addnodes
|
||||
from sphinx.builders import Builder
|
||||
from sphinx.environment import NoUri
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.console import bold, darkgreen # type: ignore
|
||||
from sphinx.util.nodes import inline_all_toctrees
|
||||
@ -72,6 +73,10 @@ class ManualPageBuilder(Builder):
|
||||
|
||||
for info in self.config.man_pages:
|
||||
docname, name, description, authors, section = info
|
||||
if docname not in self.env.all_docs:
|
||||
logger.warning(__('"man_pages" config value references unknown '
|
||||
'document %s'), docname)
|
||||
continue
|
||||
if isinstance(authors, string_types):
|
||||
if authors:
|
||||
authors = [authors]
|
||||
|
@ -403,14 +403,19 @@ def inspect_main(argv):
|
||||
def warn(self, msg):
|
||||
print(msg, file=sys.stderr)
|
||||
|
||||
filename = argv[0]
|
||||
invdata = fetch_inventory(MockApp(), '', filename) # type: ignore
|
||||
for key in sorted(invdata or {}):
|
||||
print(key)
|
||||
for entry, einfo in sorted(invdata[key].items()):
|
||||
print('\t%-40s %s%s' % (entry,
|
||||
einfo[3] != '-' and '%-40s: ' % einfo[3] or '',
|
||||
einfo[2]))
|
||||
try:
|
||||
filename = argv[0]
|
||||
invdata = fetch_inventory(MockApp(), '', filename) # type: ignore
|
||||
for key in sorted(invdata or {}):
|
||||
print(key)
|
||||
for entry, einfo in sorted(invdata[key].items()):
|
||||
print('\t%-40s %s%s' % (entry,
|
||||
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__':
|
||||
|
Loading…
Reference in New Issue
Block a user