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

-w flag doesn't create parent directories for warning/error file #10055

Closed
GlenNicholls opened this issue Jan 5, 2022 · 0 comments
Closed

-w flag doesn't create parent directories for warning/error file #10055

GlenNicholls opened this issue Jan 5, 2022 · 0 comments
Labels
api:cmdline type:proposal a feature suggestion
Milestone

Comments

@GlenNicholls
Copy link

Describe the bug

When running sphinx-build with the -w FILE flag, it raises the following exception if the directory where the file exists doesn't exist. Essentially, if the directory build doesn't exist when I run sphinx-build, it doesn't create the directory before the file which I find weird because I'm using that directory for the output of the sphinx build...

sphinx-build -n -T -b html -w build/docs/html.log docs build/docs/html

sphinx-build: error: cannot open warning file 'build/docs/html.log': [Errno 2] No such file or directory: 'build/docs/html.log'
ERROR: InvocationError for command /usr/src/app/fw-tools-pyeda/.tox/docs/bin/sphinx-build -n -T -b html -j auto -d /usr/src/app/fw-tools-pyeda/.tox/docs/tmp/doctrees docs build/docs/html -w build/docs/html.log (exited with code 2)
____________________________________________________________________________________________________ summary ____________________________________________________________________________________________________
ERROR:   docs: commands failed

How to Reproduce

$ git clone https://github.com/.../some_project
$ cd some_project
$ pip install -r requirements.txt
$ cd docs
$ make html SPHINXOPTS="-D language=de"
$ # open _build/html/index and see bla bla

Expected behavior

I would think the -w flag should create all parent directories if they don't exist. sphinx-build creates parents, so it's weird that -w doesn't.

Your project

It is proprietary unfortunately

Screenshots

No response

OS

Ubuntu Focal (docker buildpack-deps:focal)

Python version

3.8

Sphinx version

4.3.2

Sphinx extensions

'sphinx.ext.autodoc',     'sphinx.ext.doctest',     'sphinx.ext.ifconfig',     'sphinx.ext.intersphinx',     'sphinx.ext.napoleon',     'sphinx.ext.viewcode',      'sphinxarg.ext',      'sphinx_toolbox.more_autodoc.regex',

Extra tools

tox

Additional context

The actual tox command is below:

[testenv:docs]
basepython = python3
description = Build the Sphinx documentation.
sitepackages = true
extras = docs
commands =
    sphinx-build -n -T -b html -j auto -d {envtmpdir}/doctrees docs build/docs/html -w build/docs/html.log
@GlenNicholls GlenNicholls changed the title -w flag doesn't create the directory -w flag doesn't create parent directories for warning/error file Jan 5, 2022
@tk0miya tk0miya added api:cmdline type:proposal a feature suggestion and removed type:bug labels Jan 8, 2022
@tk0miya tk0miya added this to the 4.4.0 milestone Jan 8, 2022
tk0miya added a commit that referenced this issue Jan 11, 2022
Close #10055: sphinx-build: Create directories when `-w` option given
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api:cmdline type:proposal a feature suggestion
Projects
None yet
Development

No branches or pull requests

2 participants