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

gh-101100: Fix Py_DEBUG dangling references #115003

Merged
merged 8 commits into from
Feb 7, 2024

Conversation

smontanaro
Copy link
Contributor

@smontanaro smontanaro commented Feb 4, 2024

Per conversation with @AlexWaygood, here is a small proposed fix to a few broken Py_DEBUG links. My suggestion was to reference the _debug-build anchor. Aside from that, all this does so far is suppress dangling Py_DEBUG references in the same paragraphs where the _debug-build anchor is referenced.


📚 Documentation preview 📚: https://cpython-previews--115003.org.readthedocs.build/

@AlexWaygood
Copy link
Member

AlexWaygood commented Feb 4, 2024

It seems like this PR also includes all the changes from your unrelated other PR:

Was that intentional? Perhaps you had your branch for that PR checked out, instead of your main branch, before creating this branch locally? That would mean that this PR branch would "branch off" from that branch, instead of from your main branch :)

@smontanaro
Copy link
Contributor Author

sigh I just branched from my main. Apologies.

Not sure how to proceed at this point.

@AlexWaygood
Copy link
Member

sigh I just branched from my main. Apologies.

Not sure how to proceed at this point.

I fixed things up for you by pushing to your branch (you'll have to git pull locally to update your local clone and make further updates locally 🙂).

I don't work much with the C API, so I don't have strong opinions on the C API docs -- it'd be great if @serhiy-storchaka might be able to take a look at this one

@smontanaro
Copy link
Contributor Author

Thanks Alex. I'll review and see what else looks like it needs to be changed.

As an aside, I saw a GitHub Actions warning which was new to me:

Screenshot 2024-02-04 at 1 28 29 PM

Is there maybe a parsing problem in whatever tool is involved in that particular GitHub action?

@smontanaro
Copy link
Contributor Author

Oh, maybe it's complaining about the section below the message, not above it.

@AlexWaygood
Copy link
Member

As an aside, I saw a GitHub Actions warning which was new to me:
Screenshot 2024-02-04 at 1 28 29 PM

Is there maybe a parsing problem in whatever tool is involved in that particular GitHub action?

That is warning you about a separate dangling reference later on in the same paragraph (line 820). It's fine to leave that reference warning unsolved in this PR. The reason why you're seeing the warning in the "files changed" tab in this PR is because you have made other changes to that paragraph

@smontanaro
Copy link
Contributor Author

That is warning you about a separate dangling reference later on in the same paragraph (line 820). It's fine to leave that reference warning unsolved in this PR. The reason why you're seeing the warning in the "files changed" tab in this PR is because you have made other changes to that paragraph

Too late. I will revert it if it's a deal breaker, but I see no reason that it needs to actually be documented in Python's documentation.

@AlexWaygood
Copy link
Member

Too late. I will revert it if it's a deal breaker, but I see no reason that it needs to actually be documented in Python's documentation.

I don't think it's a deal-breaker :)

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to add the Py_DEBUG macro to the index.

Add the .. macro:: Py_DEBUG directive, look what index is generated for it, and add the same index with the .. index:: directive.

@smontanaro
Copy link
Contributor Author

@serhiy-storchaka I added an explicit :c:macro: PyDEBUG target in intro.rst and referenced it from test.rst. This generates both an anchor for other references and an index entry.

While I was at it, I simplified the text in test.rst. Since it already refers the reader to the debug build details in using/configure.rst, I saw no reason to actually duplicate the configure command example here.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@AlexWaygood AlexWaygood added needs backport to 3.11 only security fixes needs backport to 3.12 bug and security fixes labels Feb 7, 2024
@AlexWaygood AlexWaygood merged commit d0322fd into python:main Feb 7, 2024
25 checks passed
@miss-islington-app
Copy link

Thanks @smontanaro for the PR, and @AlexWaygood for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 7, 2024
…5003)

(cherry picked from commit d0322fd)

Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
@miss-islington-app
Copy link

Sorry, @smontanaro and @AlexWaygood, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker d0322fdf2c1a7292a43959fe5a572d783b88a1c4 3.11

@bedevere-app
Copy link

bedevere-app bot commented Feb 7, 2024

GH-115135 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Feb 7, 2024
AlexWaygood pushed a commit that referenced this pull request Feb 7, 2024
…#115135)

gh-101100: Fix Py_DEBUG dangling Sphinx references (GH-115003)
(cherry picked from commit d0322fd)

Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Feb 7, 2024

GH-115141 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Feb 7, 2024
AlexWaygood pushed a commit that referenced this pull request Feb 7, 2024
…115141)

gh-101100: Fix Py_DEBUG dangling Sphinx references (#115003)

(cherry picked from commit d0322fd)
fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this pull request Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants