forked from pool/python38
Accepting request 1031399 from home:mcepl:branches:devel:languages:python:Factory
- Add 98437-sphinx.locale._-as-gettext-in-pyspecific.patch to allow building of documentation with the latest Sphinx 5.3.0 (gh#python/cpython#98366). OBS-URL: https://build.opensuse.org/request/show/1031399 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python38?expand=0&rev=109
This commit is contained in:
parent
75d8efff80
commit
8e65405c86
54
98437-sphinx.locale._-as-gettext-in-pyspecific.patch
Normal file
54
98437-sphinx.locale._-as-gettext-in-pyspecific.patch
Normal file
@ -0,0 +1,54 @@
|
||||
From 5775f51691d7d64fb676586e008b41261ce64ac2 Mon Sep 17 00:00:00 2001
|
||||
From: "Matt.Wang" <mattwang44@gmail.com>
|
||||
Date: Wed, 19 Oct 2022 14:49:08 +0800
|
||||
Subject: [PATCH 1/2] 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.
|
||||
---
|
||||
Doc/tools/extensions/pyspecific.py | 8 ++++----
|
||||
Misc/NEWS.d/next/Documentation/2022-10-19-07-15-52.gh-issue-98366.UskMXF.rst | 1 +
|
||||
2 files changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/Doc/tools/extensions/pyspecific.py
|
||||
+++ b/Doc/tools/extensions/pyspecific.py
|
||||
@@ -26,7 +26,7 @@ try:
|
||||
from sphinx.errors import NoUri
|
||||
except ImportError:
|
||||
from sphinx.environment import NoUri
|
||||
-from sphinx.locale import translators
|
||||
+from sphinx.locale import _ as sphinx_gettext
|
||||
from sphinx.util import status_iterator, logging
|
||||
from sphinx.util.nodes import split_explicit_title
|
||||
from sphinx.writers.text import TextWriter, TextTranslator
|
||||
@@ -110,7 +110,7 @@ class ImplementationDetail(Directive):
|
||||
|
||||
def run(self):
|
||||
pnode = nodes.compound(classes=['impl-detail'])
|
||||
- label = translators['sphinx'].gettext(self.label_text)
|
||||
+ label = sphinx_gettext(self.label_text)
|
||||
content = self.content
|
||||
add_text = nodes.strong(label, label)
|
||||
if self.arguments:
|
||||
@@ -179,7 +179,7 @@ class AuditEvent(Directive):
|
||||
else:
|
||||
args = []
|
||||
|
||||
- label = translators['sphinx'].gettext(self._label[min(2, len(args))])
|
||||
+ label = sphinx_gettext(self._label[min(2, len(args))])
|
||||
text = label.format(name="``{}``".format(name),
|
||||
args=", ".join("``{}``".format(a) for a in args if a))
|
||||
|
||||
@@ -357,7 +357,7 @@ class DeprecatedRemoved(Directive):
|
||||
else:
|
||||
label = self._removed_label
|
||||
|
||||
- label = translators['sphinx'].gettext(label)
|
||||
+ label = sphinx_gettext(label)
|
||||
text = label.format(deprecated=self.arguments[0], removed=self.arguments[1])
|
||||
if len(self.arguments) == 3:
|
||||
inodes, messages = self.state.inline_text(self.arguments[2],
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Documentation/2022-10-19-07-15-52.gh-issue-98366.UskMXF.rst
|
||||
@@ -0,0 +1 @@
|
||||
+Use sphinx.locale._ as the gettext function in pyspecific.py.
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 21 10:14:03 UTC 2022 - Matej Cepl <mcepl@suse.com>
|
||||
|
||||
- Add 98437-sphinx.locale._-as-gettext-in-pyspecific.patch to
|
||||
allow building of documentation with the latest Sphinx 5.3.0
|
||||
(gh#python/cpython#98366).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 20 11:49:44 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
|
||||
|
||||
|
@ -173,6 +173,9 @@ Patch34: bpo34990-2038-problem-compileall.patch
|
||||
Patch36: support-expat-CVE-2022-25236-patched.patch
|
||||
# PATCH-FIX-OPENSUSE platlibdir-in-sys.patch bsc#1204395
|
||||
Patch37: platlibdir-in-sys.patch
|
||||
# PATCH-FIX-UPSTREAM 98437-sphinx.locale._-as-gettext-in-pyspecific.patch gh#python/cpython#98366 mcepl@suse.com
|
||||
# this patch makes things totally awesome
|
||||
Patch38: 98437-sphinx.locale._-as-gettext-in-pyspecific.patch
|
||||
BuildRequires: autoconf-archive
|
||||
BuildRequires: automake
|
||||
BuildRequires: fdupes
|
||||
@ -440,6 +443,7 @@ other applications.
|
||||
%patch34 -p1
|
||||
%patch36 -p1
|
||||
%patch37 -p1
|
||||
%patch38 -p1
|
||||
|
||||
# drop Autoconf version requirement
|
||||
sed -i 's/^AC_PREREQ/dnl AC_PREREQ/' configure.ac
|
||||
|
Loading…
Reference in New Issue
Block a user