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

Better crash messages when a file isn't found because it was removed by the user during the run #10786

Closed
Pierre-Sassoulas opened this issue Aug 25, 2022 · 0 comments · Fixed by #12183
Labels
builder easy issue that can be solved by beginners good first issue type:enhancement enhance or introduce a new feature

Comments

@Pierre-Sassoulas
Copy link

Hello,

Thank you for working on Sphinx, I used this lib heavily for years.

I removed a file during the sphinx run and got the following crash:

Traceback (most recent call last):

  File "/home/pierre/pylint/venv/lib/python3.10/site-packages/sphinx/cmd/build.py", line 276, in build_main

    app.build(args.force_all, filenames)

  File "/home/pierre/pylint/venv/lib/python3.10/site-packages/sphinx/application.py", line 329, in build

    self.builder.build_update()

  File "/home/pierre/pylint/venv/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 288, in build_update

    self.build(to_build,

  File "/home/pierre/pylint/venv/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 352, in build

    self.write(docnames, list(updated_docnames), method)

  File "/home/pierre/pylint/venv/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 544, in write

    self._write_serial(sorted(docnames))

  File "/home/pierre/pylint/venv/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 554, in _write_serial

    self.write_doc(docname, doctree)

  File "/home/pierre/pylint/venv/lib/python3.10/site-packages/sphinx/builders/html/__init__.py", line 649, in write_doc

    self.handle_page(docname, ctx, event_arg=doctree)

  File "/home/pierre/pylint/venv/lib/python3.10/site-packages/sphinx/builders/html/__init__.py", line 1098, in handle_page

    copyfile(self.env.doc2path(pagename), source_name)

  File "/home/pierre/pylint/venv/lib/python3.10/site-packages/sphinx/util/osutil.py", line 87, in copyfile

    if not path.exists(dest) or not filecmp.cmp(source, dest):

  File "/usr/lib/python3.10/filecmp.py", line 53, in cmp

    s1 = _sig(os.stat(f1))

FileNotFoundError: [Errno 2] No such file or directory: '/home/pierre/pylint/doc/user_guide/messages/warning/missing-pylint-confidence.rst'



Exception occurred:

  File "/usr/lib/python3.10/filecmp.py", line 53, in cmp

    s1 = _sig(os.stat(f1))

FileNotFoundError: [Errno 2] No such file or directory: '/home/pierre/pylint/doc/user_guide/messages/warning/missing-pylint-confidence.rst'

The full traceback has been saved in /tmp/sphinx-err-5ytmoq86.log, if you want to report the issue to the developers.

Please also report this if it was a user error, so that a better error message can be provided next time.

A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!

Describe the solution you'd like

Better error message without crash.

Describe alternatives you've considered

Not doing anything is reasonable too.

@Pierre-Sassoulas Pierre-Sassoulas added the type:enhancement enhance or introduce a new feature label Aug 25, 2022
@AA-Turner AA-Turner added this to the some future version milestone Sep 29, 2022
@AA-Turner AA-Turner added builder good first issue easy issue that can be solved by beginners labels Jan 12, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
builder easy issue that can be solved by beginners good first issue type:enhancement enhance or introduce a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants