File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1+ NEXT
2+ ====
3+
4+ * Fix tests for Python 3.15.0a5+
5+ Patch by Edgar Ramírez-Mondragón
6+
17Release 9.1.0 (released Dec 31, 2025)
28=====================================
39
Original file line number Diff line number Diff line change @@ -27,13 +27,20 @@ def _init_console(
2727 locale_dir : str | os .PathLike [str ] | None = sphinx .locale ._LOCALE_DIR ,
2828 catalog : str = 'sphinx' ,
2929) -> tuple [gettext .NullTranslations , bool ]:
30- """Monkeypatch ``init_console`` to skip its action .
30+ """Monkeypatch ``init_console`` to skip locale loading .
3131
3232 Some tests rely on warning messages in English. We don't want
3333 CLI tests to bleed over those tests and make their warnings
3434 translated.
35+
36+ We still register a NullTranslations so that ``__()`` (the console
37+ translation function) returns a plain ``str`` rather than a lazy
38+ ``_TranslationProxy``. NullTranslations passes every message through
39+ unchanged, so all strings stay in English.
3540 """
36- return gettext .NullTranslations (), False
41+ null = gettext .NullTranslations ()
42+ sphinx .locale .translators ['console' , catalog ] = null
43+ return null , False
3744
3845
3946sphinx .locale .init_console = _init_console
You can’t perform that action at this time.
0 commit comments