Fix #9217: manpage: Dirname of man_make_section_directory is wrong

* Correct: man/man1
* Wrong:   man/1
This commit is contained in:
Takeshi KOMIYA 2021-05-17 23:18:00 +09:00
parent d6c19126c5
commit 79d9701a00
3 changed files with 6 additions and 3 deletions

View File

@ -51,6 +51,8 @@ Bugs fixed
* #8597: autodoc: a docsting having metadata only should be treated as
undocumented
* #9185: autodoc: typehints for overloaded functions and methods are inaccurate
* #9217: manpage: The name of manpage directory that is generated by
:confval:`man_make_section_directory` is not correct
Testing
--------

View File

@ -79,8 +79,9 @@ class ManualPageBuilder(Builder):
docsettings.section = section
if self.config.man_make_section_directory:
ensuredir(path.join(self.outdir, str(section)))
targetname = '%s/%s.%s' % (section, name, section)
dirname = 'man%s' % section
ensuredir(path.join(self.outdir, dirname))
targetname = '%s/%s.%s' % (dirname, name, section)
else:
targetname = '%s.%s' % (name, section)

View File

@ -34,7 +34,7 @@ def test_all(app, status, warning):
confoverrides={'man_make_section_directory': True})
def test_man_make_section_directory(app, status, warning):
app.build()
assert (app.outdir / '1' / 'python.1').exists()
assert (app.outdir / 'man1' / 'python.1').exists()
@pytest.mark.sphinx('man', testroot='directive-code')