-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Unclear error message: TypeError: unsupported operand type(s) for /: 'str' and 'str' #13018
Comments
@sylvestre are you able to run with
We do have test converage for this particular warning, so I don't think it's an issue with Sphinx in the first instance. An easy reproduction case would be a sample Test
====
.. image:: test.png and your current from pathlib import Path
IMG_PATH = Path('test.png')
def handler(app):
assert IMG_PATH.exists()
IMG_PATH.unlink()
return []
def setup(app):
IMG_PATH.touch()
app.connect('html-collect-pages', handler) When running this locally ( A |
Indeed, seems to be an str:
|
@AA-Turner I'm not an expert but from reading thousands of threads on SO this segment to me is synonymous to trouble:
@sylvestre I'm not a Linux user but the above suggests you've installed Sphinx to a Python base installation (the kind that's a default and comes pre-installed with an OS)? Both in Windows and Linux this is known to cause inexplicable problems and a solution might be to install Sphinx to a clean venv and activate it to build the docs. Otherwise Python installations that aren't clean can be non-standard and cause all kinds of problems. |
We had this same issue in https://github.com/python/python-docs-es/. It turns out it was our |
We could probably add getters/setters to raise warnings. @rtobar what was your use-case for changing srcdir? We assume it is immutable internally, I think. A |
@AA-Turner thanks for the quick reply. In our case at https://github.com/python/python-docs-es/ (Spanish translation of the Python documentation) we have the following layout:
I'm not really familiar with how and why this setup came to be, as well as whether this is aligned with best practices for managing translation projects, so I'd be more than happy to listen for some advice. It seems that the Firefox folks might be on the same boat, re-defining |
We currently need to replace the include:: directives in the cpython documentation source files to fix an issue that sphinx/docutils have with relative source files after changing the app.srcdir in our conf.py. Instead of doing this, let's define the app.srcdir property as an absolute path. This removes the issue altogether, yielding a correct build without the need to modify the documentation source files. This change seems to have the nice side effect that successive builds are not incremental rather than starting from scratch. Edit: additionally, we now define sphinx's `app.srcdir` as a Path, which seems to be a requirement at least in 8.1.3, which is what we''l use for building the 3.13 docs. See sphinx-doc/sphinx#13018. Closes #1844 --------- Signed-off-by: Rodrigo Tobar <[email protected]>
Current master now enforces that We don't currently warn on this use-case, perhaps we should? But we could add this later once we use A |
Describe the bug
Trying to upgrade Firefox doc to version 8.1.2, I am getting this exception. it could be catch to provide a better error message.
I guess it is because a file is missing
How to Reproduce
Quite complex for now
Environment Information
Sphinx extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: