summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-05-17 23:18:00 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-05-17 23:18:24 +0900
commit79d9701a005db6aee2edaa330f6339031bb433d8 (patch)
tree42465d3965691576d5de3c538b613f42cacc38aa
parentd6c19126c5ebd788619d491d4e70c949de9fd2ff (diff)
downloadsphinx-git-79d9701a005db6aee2edaa330f6339031bb433d8.tar.gz
Fix #9217: manpage: Dirname of man_make_section_directory is wrong
* Correct: man/man1 * Wrong: man/1
-rw-r--r--CHANGES2
-rw-r--r--sphinx/builders/manpage.py5
-rw-r--r--tests/test_build_manpage.py2
3 files changed, 6 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index ac0f64cb9..5ede9f9a3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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
--------
diff --git a/sphinx/builders/manpage.py b/sphinx/builders/manpage.py
index 532d2b8fe..9d8fd5e67 100644
--- a/sphinx/builders/manpage.py
+++ b/sphinx/builders/manpage.py
@@ -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)
diff --git a/tests/test_build_manpage.py b/tests/test_build_manpage.py
index a017abc69..0b7ce2396 100644
--- a/tests/test_build_manpage.py
+++ b/tests/test_build_manpage.py
@@ -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')