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

BuildEnvironment.docname can now be None #11620

Closed
AA-Turner opened this issue Aug 18, 2023 · 7 comments
Closed

BuildEnvironment.docname can now be None #11620

AA-Turner opened this issue Aug 18, 2023 · 7 comments

Comments

@AA-Turner
Copy link
Member

It seems that BuildEnvironment.docname can now be None:

def docname(self) -> str:

or at least env.docname in read-source event can now be None:

env.events.emit('source-read', env.docname, arg)

Ref: sphinx-gallery/sphinx-gallery#1175

Originally posted by @lucyleeow in #11605 (comment)

@AA-Turner
Copy link
Member Author

@lucyleeow thanks for this report, do you have a reproducer for this at all please?

Thanks,
Adam

@AA-Turner
Copy link
Member Author

May be related to #10678 & #11510

@AA-Turner
Copy link
Member Author

Not a bug in Sphinx, will report upstream (sphinx-gallery/sphinx-gallery#1175)

@AA-Turner AA-Turner closed this as not planned Won't fix, can't repro, duplicate, stale Aug 18, 2023
@lucyleeow
Copy link

Thank you @AA-Turner for looking into this!

Would it be appropriate to update the docs so docname return type is str or None.? Though I do note that path2doc has always had return type str or None, so this is not a new change.

jepler added a commit to jepler/circuitpython that referenced this issue Aug 22, 2023
.. and remove the substring check for the file.

this fixes the problem with sphinx 7.2.2 that the "docname" can
be None (see sphinx-doc/sphinx#11620)
@mgeier
Copy link
Contributor

mgeier commented Aug 26, 2023

I seem to have the same problem in my sphinx-last-updated-by-git extension. I can work around it with mgeier/sphinx-last-updated-by-git#59, but I'm not sure if that's the right thing to do.

I think at least the source-read docs should be updated to explain in which situations docname can be None.

@mgeier
Copy link
Contributor

mgeier commented Aug 26, 2023

I have added a reproducer: #11648

We can continue discussion there.

@AA-Turner
Copy link
Member Author

Closing as fixed by #11657.

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

No branches or pull requests

3 participants