Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sphinx raises an exception when trying to build python 3.13 doc with devhelp #12416

Closed
danigm opened this issue Jun 6, 2024 · 3 comments · Fixed by #12417
Closed

sphinx raises an exception when trying to build python 3.13 doc with devhelp #12416

danigm opened this issue Jun 6, 2024 · 3 comments · Fixed by #12417
Labels
extensions:sphinxcontrib Relating to the sphinxcontrib-* extensions type:bug

Comments

@danigm
Copy link

danigm commented Jun 6, 2024

Describe the bug

Sphinx raises an exception when trying to build the Python 3.13 documentation:

$ cd Doc
$ sphinx-build -a -b devhelp . build/devhelp
...
dumping devhelp index...
 
Exception occurred:
File "/usr/lib/python3.11/site-packages/sphinx/environment/__init__.py", line 603, in get_doctree
    with open(filename, 'rb') as f:
         ^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/abuild/rpmbuild/BUILD/Python-3.13.0b2/Doc/build/devhelp/.doctrees/index.doctree'

This is due to the removal of master_doc = 'contents' in the conf.py file done in this PR: python/cpython#117853

I've reported this in cpython project: python/cpython#120150, but maybe the problem is in sphinx or sphinxcontrib-devhelp project.

How to Reproduce

Download python 3.13 beta code and try to build the doc:

$ cd Doc
$ sphinx-build -a -b devhelp . build/devhelp

Environment Information

Platform:              linux; (Linux-6.9.1-1-default-x86_64-with-glibc2.39)
Python version:        3.11.9 (main, Apr 08 2024, 06:18:15) [GCC])
Python implementation: CPython
Sphinx version:        7.2.6
Docutils version:      0.20.1
Jinja2 version:        3.1.4
Pygments version:      2.18.0

OS:                    **openSUSE Tumbleweed**
sphinxcontrib-devhelp: **1.0.6**

Sphinx extensions

extensions = [
    'asdl_highlight',
    'c_annotations',
    'escape4chm',
    'glossary_search',
    'peg_highlight',
    'pyspecific',
    'sphinx.ext.coverage',
    'sphinx.ext.doctest',
    'sphinx.ext.extlinks',
]

Additional context

No response

@danigm danigm added the type:bug label Jun 6, 2024
@picnixz
Copy link
Member

picnixz commented Jun 6, 2024

First of all, the docs are very slow to build on my side but I don't know whether the issue is because of Sphinx, CPython or me. Second, have you tried wiping out a possible existing build folder? and thirdly, when is the exception occurring: is during the read or the write phase? because I have no issue in the reading phase and the writing phase starts correctly (though it's still ongoing...)

@picnixz
Copy link
Member

picnixz commented Jun 6, 2024

So the docs are finally done and indeed there is an issue (I've got the same as you). Mmh, I don't know what happened. I'll try investigating.

@picnixz
Copy link
Member

picnixz commented Jun 6, 2024

Ok, the devhelp build is ASTRONOMICALLY slow. What's the reason? I don't know. I don't have an issue with building the files for Sphinx but Python is hanging for some reason. So it should not be my disk.

Anyway, I understood what happens. We have:

	'master_doc': _Opt('index', 'env', ()),
	'root_doc': _Opt(lambda config: config.master_doc, 'env', ()),

meaning that, by default, master_doc is set to 'index' and that root_doc is set to master_doc. If you set root_doc, then master_doc will not be correctly reflected, so you'll end-up with an invalid value.

The issue is that sphinxcontrib-devhelp is using self.config.master_doc instead of root_doc so I'll change that on the other repo. Note that I don't have permissions to publish on pypi =/

@jayaddison jayaddison added the extensions:sphinxcontrib Relating to the sphinxcontrib-* extensions label Jun 10, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions:sphinxcontrib Relating to the sphinxcontrib-* extensions type:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants