Skip to content

gh-98366: use sphinx.locale._ as gettext() in pyspecific.py#98437

Merged
ezio-melotti merged 1 commit into
python:mainfrom
mattwang44:fix-pyspecific-sphinx-locale-gettext
Nov 11, 2022
Merged

gh-98366: use sphinx.locale._ as gettext() in pyspecific.py#98437
ezio-melotti merged 1 commit into
python:mainfrom
mattwang44:fix-pyspecific-sphinx-locale-gettext

Conversation

@mattwang44

@mattwang44 mattwang44 commented Oct 19, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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
Comment thread Misc/NEWS.d/next/Documentation/2022-10-19-07-15-52.gh-issue-98366.UskMXF.rst Outdated
@marxin

marxin commented Oct 21, 2022

Copy link
Copy Markdown

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

@mcepl

mcepl commented Oct 21, 2022

Copy link
Copy Markdown
Contributor

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
@mattwang44 mattwang44 requested a review from merwok October 21, 2022 15:05
@AlexWaygood AlexWaygood requested a review from AA-Turner October 21, 2022 15:29
@AA-Turner

Copy link
Copy Markdown
Member

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

A

@AlexWaygood

Copy link
Copy Markdown
Member

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

@mattwang44, are you able to do that?

@mattwang44

mattwang44 commented Oct 21, 2022

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

Should this be backported to 3.11 and 3.10 too?

@AA-Turner

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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
Copy Markdown

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.

9 participants