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-98366: use sphinx.locale._ as gettext() in pyspecific.py #98437

Merged

Conversation

mattwang44
Copy link
Contributor

@mattwang44 mattwang44 commented Oct 19, 2022

sphinx 5.3 changed sphinx.locale.translators from a defaultdict(gettext.NullTranslations) to a dict (commit), which led to failure of pyspecific.py. Use sphinx.locale._ as gettext() to fix the issue.

@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@mattwang44 mattwang44 marked this pull request as draft October 19, 2022 07:09
@mattwang44 mattwang44 marked this pull request as ready for review October 19, 2022 07:38
@marxin
Copy link

marxin commented Oct 21, 2022

May I please ping this, it's blocking Sphinx 5.3 update in openSUSE CI right now.

@mcepl
Copy link
Contributor

mcepl commented Oct 21, 2022

May I please ping this, it's blocking Sphinx 5.3 update in openSUSE CI right now.

@ezio-melotti, @merwok, @JulienPalard, @willingc You are enlisted on https://devguide.python.org/core-developers/experts/ as experts for documentation. Could you please review this PR? Thank you.

@mattwang44 mattwang44 force-pushed the fix-pyspecific-sphinx-locale-gettext branch from f22bc2b to 5775f51 Compare October 21, 2022 15:02
…bility in pyspecific.py

[why] spinix 5.3 changed locale.translators from a defaultdict(gettext.NullTranslations) to a dict, which leads to failure of pyspecific.py. Use sphinx.locale._ as gettext to fix the issue.
@mattwang44 mattwang44 force-pushed the fix-pyspecific-sphinx-locale-gettext branch from 5775f51 to 383f9a7 Compare October 21, 2022 15:03
@AA-Turner
Copy link
Member

Desk review looks reasonable, though ideally we'd confirm by building one of the translations against this PR.

A

@AlexWaygood
Copy link
Member

ideally we'd confirm by building one of the translations against this PR.

@mattwang44, are you able to do that?

@mattwang44
Copy link
Contributor Author

mattwang44 commented Oct 21, 2022

@AA-Turner @AlexWaygood
A PR in python-docs-zh-tw for testing this branch with sphinx==5.3 is created and the building job has passed.

@AA-Turner
Copy link
Member

Great that the build passed. Is the translation correct for implementation detail directives, to sanity check that the new code works?

A

@mattwang44
Copy link
Contributor Author

Great that the build passed. Is the translation correct for implementation detail directives, to sanity check that the new code works?

A

The static site of translated doc in zh_TW has been deployed to the GitHub page (GitHub Action logs is here). I've checked a couple of recently-merged translation PRs and it looks fine to me.

@ezio-melotti
Copy link
Member

Should this be backported to 3.11 and 3.10 too?

@AA-Turner
Copy link
Member

Yes!

A

@AlexWaygood AlexWaygood added needs backport to 3.10 only security fixes needs backport to 3.11 only security fixes labels Nov 11, 2022
@miss-islington
Copy link
Contributor

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

@miss-islington
Copy link
Contributor

Thanks @mattwang44 for the PR, and @ezio-melotti for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 11, 2022
…thonGH-98437)

fix(doc-tools): use sphinx.locale._ as gettext() for backward-compatibility in pyspecific.py

[why] spinix 5.3 changed locale.translators from a defaultdict(gettext.NullTranslations) to a dict, which leads to failure of pyspecific.py. Use sphinx.locale._ as gettext to fix the issue.
(cherry picked from commit d26ee8a)

Co-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com>
@bedevere-bot
Copy link

GH-99358 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Nov 11, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 11, 2022
…thonGH-98437)

fix(doc-tools): use sphinx.locale._ as gettext() for backward-compatibility in pyspecific.py

[why] spinix 5.3 changed locale.translators from a defaultdict(gettext.NullTranslations) to a dict, which leads to failure of pyspecific.py. Use sphinx.locale._ as gettext to fix the issue.
(cherry picked from commit d26ee8a)

Co-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com>
@bedevere-bot
Copy link

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

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Nov 11, 2022
miss-islington added a commit that referenced this pull request Nov 11, 2022
fix(doc-tools): use sphinx.locale._ as gettext() for backward-compatibility in pyspecific.py

[why] spinix 5.3 changed locale.translators from a defaultdict(gettext.NullTranslations) to a dict, which leads to failure of pyspecific.py. Use sphinx.locale._ as gettext to fix the issue.
(cherry picked from commit d26ee8a)

Co-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com>
miss-islington added a commit that referenced this pull request Nov 11, 2022
fix(doc-tools): use sphinx.locale._ as gettext() for backward-compatibility in pyspecific.py

[why] spinix 5.3 changed locale.translators from a defaultdict(gettext.NullTranslations) to a dict, which leads to failure of pyspecific.py. Use sphinx.locale._ as gettext to fix the issue.
(cherry picked from commit d26ee8a)

Co-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com>
@mattwang44 mattwang44 deleted the fix-pyspecific-sphinx-locale-gettext branch November 12, 2022 06:37
ethanfurman pushed a commit to ethanfurman/cpython that referenced this pull request Nov 12, 2022
…thon#98437)

fix(doc-tools): use sphinx.locale._ as gettext() for backward-compatibility in pyspecific.py

[why] spinix 5.3 changed locale.translators from a defaultdict(gettext.NullTranslations) to a dict, which leads to failure of pyspecific.py. Use sphinx.locale._ as gettext to fix the issue.
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.

None yet

9 participants