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

Do not crash when reporting bad spelling in docstrings #168

Merged
merged 2 commits into from
May 28, 2022

Conversation

pgerell
Copy link

@pgerell pgerell commented May 26, 2022

Fix for issue #167

@ejd
Copy link

ejd commented May 26, 2022

This PR fixes the issue I reported in #167.

@dhellmann
Copy link
Member

This does look like it addresses the problem, but every consumer of the Checker would have to know to do the same conversion. I think I'd rather change the Checker so that it always returns a number for the offset. What do you think?

@pgerell
Copy link
Author

pgerell commented May 27, 2022

I believe the checker always returns a number. The problem is that docutils.utils.get_source_line(node) sometimes returns None.
This happens for all :param: arguments in docstrings, not only ones without newlines. If the contents of the docstring is copied into a rst-file the node gets a line number.

@dhellmann
Copy link
Member

I believe the checker always returns a number.

OK, I misunderstood the source of the bug.

@mergify mergify bot merged commit 904862c into sphinx-contrib:master May 28, 2022
@dhellmann
Copy link
Member

This fix is included in release 7.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants