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

Error while building restructured documentation #5326

Closed
pradyunsg opened this issue Aug 21, 2018 · 3 comments
Closed

Error while building restructured documentation #5326

pradyunsg opened this issue Aug 21, 2018 · 3 comments

Comments

@pradyunsg
Copy link
Contributor

Problem

  • This is a case of user error -- specifying the man page location in an incorrect manner. I'm getting a traceback instead of a helpful message here.

Procedure to reproduce the problem

git clone -b sphinx-error --single-branch https://github.com/pradyunsg/pip.git
cd pip
tox -e docs

Error logs / results

# Sphinx version: 1.7.7
# Python version: 3.6.5 (CPython)
# Docutils version: 0.14 
# Jinja2 version: 2.10
# Last messages:
#   done
#   
#   checking consistency...
#   
#   done
#   
#   writing...
#   
#   pip.1 {
#   
# Loaded extensions:
#   alabaster (0.7.11) from /Users/pradyunsg/Projects/pip/.tox/docs/lib/python3.6/site-packages/alabaster/__init__.py
#   sphinx.ext.extlinks (1.7.7) from /Users/pradyunsg/Projects/pip/.tox/docs/lib/python3.6/site-packages/sphinx/ext/extlinks.py
#   pip_sphinxext (unknown version) from /Users/pradyunsg/Projects/pip/docs/pip_sphinxext.py
#   sphinx.ext.intersphinx (1.7.7) from /Users/pradyunsg/Projects/pip/.tox/docs/lib/python3.6/site-packages/sphinx/ext/intersphinx.py
Traceback (most recent call last):
  File "/Users/pradyunsg/Projects/pip/.tox/docs/lib/python3.6/site-packages/sphinx/cmdline.py", line 304, in main
    app.build(args.force_all, filenames)
  File "/Users/pradyunsg/Projects/pip/.tox/docs/lib/python3.6/site-packages/sphinx/application.py", line 331, in build
    self.builder.build_update()
  File "/Users/pradyunsg/Projects/pip/.tox/docs/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 337, in build_update
    self.build(['__all__'], to_build)
  File "/Users/pradyunsg/Projects/pip/.tox/docs/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 403, in build
    self.write(docnames, list(updated_docnames), method)
  File "/Users/pradyunsg/Projects/pip/.tox/docs/lib/python3.6/site-packages/sphinx/builders/manpage.py", line 87, in write
    tree = self.env.get_doctree(docname)
  File "/Users/pradyunsg/Projects/pip/.tox/docs/lib/python3.6/site-packages/sphinx/environment/__init__.py", line 786, in get_doctree
    with open(doctree_filename, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/pradyunsg/Projects/pip/.tox/docs/tmp/doctrees/man/man/index.doctree'

Expected results

A better error message.

Reproducible project / your project

  • Provided above.

Environment info

  • OS: MacOS High Sierra
  • Python version: 2.7 or 3.6
  • Sphinx version: 1.7.7

What I'm trying to do: Use a single conf.py file to build both html and man pages, which are in their own dedicated sub-directories; which both use a custom plugin from the same directory as conf.py.

@tk0miya tk0miya added this to the 1.7.8 milestone Aug 22, 2018
tk0miya added a commit to tk0miya/sphinx that referenced this issue Aug 22, 2018

Verified

This commit was signed with the committer’s verified signature.
…ed as ``man_pages``
@tk0miya
Copy link
Member

tk0miya commented Aug 22, 2018

Thank you for reporting.
I reproduced the error if man_pages option contains invalid docname.

tk0miya added a commit to tk0miya/sphinx that referenced this issue Aug 22, 2018
tk0miya added a commit that referenced this issue Aug 22, 2018
Fix #5326: manpage: crashed when invalid docname is specified as ``man_pages``
@tk0miya
Copy link
Member

tk0miya commented Aug 22, 2018

I added warning at #5330.
Thank you for reporting.

@tk0miya tk0miya closed this as completed Aug 22, 2018
@pradyunsg
Copy link
Contributor Author

Thanks for the super quick fix! :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants