cpython icon indicating copy to clipboard operation
cpython copied to clipboard

gh-95914: Add Py_UNICODE encode APIs removed in PEP 624 to 3.11 What's New

Open CAM-Gerlach opened this issue 3 years ago • 2 comments

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?

  • Issue: gh-95914

CAM-Gerlach avatar Aug 16 '22 05:08 CAM-Gerlach

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).

hugovk avatar Aug 16 '22 08:08 hugovk

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.

CAM-Gerlach avatar Aug 16 '22 10:08 CAM-Gerlach

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

pablogsal avatar Aug 18 '22 13:08 pablogsal

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

ezio-melotti avatar Aug 18 '22 14:08 ezio-melotti

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

CAM-Gerlach avatar Aug 18 '22 21:08 CAM-Gerlach

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

miss-islington avatar Aug 18 '22 23:08 miss-islington

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

bedevere-bot avatar Aug 18 '22 23:08 bedevere-bot