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-95914: Add Py_UNICODE encode APIs removed in PEP 624 to 3.11 What's New #96016

Merged
merged 2 commits into from
Aug 18, 2022

Conversation

CAM-Gerlach
Copy link
Member

@CAM-Gerlach CAM-Gerlach commented Aug 16, 2022

Add a mention of the deprecated Py_UNICODE encode functions removed in Python 3.11 per PEP-624 by @methane in issue #88195 / PR #25881 to 3.11 What's New, as discussed in #95914 .

Inada-san, could you take a look at this?

Also, @AA-Turner @ezio-melotti @hugovk , any idea why ! appears to not be working as documented in :c:func: here, resulting in -n warnings and incorrect rendering? Does it have something to do with the legacy C role support still used by the CPython docs?

@hugovk
Copy link
Member

hugovk commented Aug 16, 2022

Also, @AA-Turner @ezio-melotti @hugovk , any idea why ! appears to not be working as documented in :c:func: here, resulting in -n warnings and incorrect rendering?

Nope... The ! prefix is meant to prevent creating a reference/hyperlink. But because the functions have been removed, you can omit the ! and it won't create a link anyway (and will render as code formatting).

@CAM-Gerlach
Copy link
Member Author

CAM-Gerlach commented Aug 16, 2022

The ! prefix is meant to prevent creating a reference/hyperlink.

Right, which is why I don't understand why it doesn't work, unless this is a Spihnx bug or some corner case (which I searched for at some length in the Sphinx repo and googled, to no avail). I figure if anyone knows, @AA-Turner would...

But because the functions have been removed, you can omit the ! and it won't create a link anyway (and will render as code formatting).

Right, of course, but the whole reason I'm adding the ! is because the functions have been removed, so Sphinx doesn't try to link them and fail with a ton of spurious warnings, obscuring real ones about actual bad references/object names amidst the noise. In that case, if for whatever reason ! doesn't work in the C domain, it would be IMO better to just use literals (as is generally used elsewhere) than known-broken references that generate a ton of spurious warnings.

@pablogsal
Copy link
Member

@CAM-Gerlach Is this still a draft or can it be reviewed?

@ezio-melotti
Copy link
Member

I believe the markup for removed functions should be fixed before merging -- from :c:func:`...` to just ``...``.

@CAM-Gerlach CAM-Gerlach marked this pull request as ready for review August 18, 2022 21:01
@CAM-Gerlach
Copy link
Member Author

CAM-Gerlach commented Aug 18, 2022

I ended up going with the default-domain :func:`!...` for now, so at least the formatting is consistent and the semantics are close enough. However, I am still curious to know what's going on there...

This should be ready for final review now @pablogsal

Copy link
Member

@pablogsal pablogsal left a comment

Choose a reason for hiding this comment

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

LGTM!

@pablogsal pablogsal merged commit b6d88b7 into python:main Aug 18, 2022
@miss-islington
Copy link
Contributor

Thanks @CAM-Gerlach for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 18, 2022
… What's New (pythonGH-96016)

* 3.11 Whatsnew: Add Py_UNICODE encode functions removed in PEP 624

* Just use :func: instead of :c:func: for non-resolved funcs so ! works
(cherry picked from commit b6d88b7)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Aug 18, 2022
@bedevere-bot
Copy link

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

miss-islington added a commit that referenced this pull request Aug 19, 2022
…s New (GH-96016)

* 3.11 Whatsnew: Add Py_UNICODE encode functions removed in PEP 624

* Just use :func: instead of :c:func: for non-resolved funcs so ! works
(cherry picked from commit b6d88b7)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
@CAM-Gerlach CAM-Gerlach mentioned this pull request Sep 26, 2022
33 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants