babel fails to build with Python 3.11.0a2. =================================== FAILURES =================================== _____________________ TranslationsTestCase.test_dnpgettext _____________________ self = <tests.test_support.TranslationsTestCase testMethod=test_dnpgettext> def test_dnpgettext(self): self.assertEqualTypeToo( 'VohD1', self.translations.dngettext('messages1', 'foo1', 'foos1', 1)) self.assertEqualTypeToo( 'VohsD1', self.translations.dngettext('messages1', 'foo1', 'foos1', 2)) self.assertEqualTypeToo( > 'VohCTXD1', self.translations.dnpgettext('messages1', 'foo', 'foo1', 'foos1', 1)) tests/test_support.py:149: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ babel/support.py:508: in dnpgettext return self._domains.get(domain, self).npgettext(context, singular, _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Translations: "PROJECT VERSION">, context = 'foo', singular = 'foo1' plural = 'foos1', num = 1 def npgettext(self, context, singular, plural, num): """Do a plural-forms lookup of a message id. `singular` is used as the message id for purposes of lookup in the catalog, while `num` is used to determine which plural form to use. The returned message string is an 8-bit string encoded with the catalog's charset encoding, if known. If the message id for `context` is not found in the catalog, and a fallback is specified, the request is forwarded to the fallback's ``npgettext()`` method. Otherwise, when ``num`` is 1 ``singular`` is returned, and ``plural`` is returned in all other cases. """ ctxt_msg_id = self.CONTEXT_ENCODING % (context, singular) try: tmsg = self._catalog[(ctxt_msg_id, self.plural(num))] > if self._output_charset: E AttributeError: 'Translations' object has no attribute '_output_charset' babel/support.py:412: AttributeError _____________________ TranslationsTestCase.test_dpgettext ______________________ self = <tests.test_support.TranslationsTestCase testMethod=test_dpgettext> def test_dpgettext(self): self.assertEqualTypeToo( 'VohD', self.translations.dgettext('messages1', 'foo')) self.assertEqualTypeToo( > 'VohCTXD', self.translations.dpgettext('messages1', 'foo', 'foo')) tests/test_support.py:128: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ babel/support.py:487: in dpgettext return self._domains.get(domain, self).pgettext(context, message) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Translations: "PROJECT VERSION">, context = 'foo', message = 'foo' def pgettext(self, context, message): """Look up the `context` and `message` id in the catalog and return the corresponding message string, as an 8-bit string encoded with the catalog's charset encoding, if known. If there is no entry in the catalog for the `message` id and `context` , and a fallback has been set, the look up is forwarded to the fallback's ``pgettext()`` method. Otherwise, the `message` id is returned. """ ctxt_msg_id = self.CONTEXT_ENCODING % (context, message) missing = object() tmsg = self._catalog.get(ctxt_msg_id, missing) if tmsg is missing: if self._fallback: return self._fallback.pgettext(context, message) return message # Encode the Unicode tmsg back to an 8-bit string, if possible > if self._output_charset: E AttributeError: 'Translations' object has no attribute '_output_charset' babel/support.py:376: AttributeError _____________________ TranslationsTestCase.test_npgettext ______________________ self = <tests.test_support.TranslationsTestCase testMethod=test_npgettext> def test_npgettext(self): self.assertEqualTypeToo('Voh1', self.translations.ngettext('foo1', 'foos1', 1)) self.assertEqualTypeToo('Vohs1', self.translations.ngettext('foo1', 'foos1', 2)) self.assertEqualTypeToo('VohCTX1', > self.translations.npgettext('foo', 'foo1', 'foos1', 1)) tests/test_support.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Translations: "PROJECT VERSION">, context = 'foo', singular = 'foo1' plural = 'foos1', num = 1 def npgettext(self, context, singular, plural, num): """Do a plural-forms lookup of a message id. `singular` is used as the message id for purposes of lookup in the catalog, while `num` is used to determine which plural form to use. The returned message string is an 8-bit string encoded with the catalog's charset encoding, if known. If the message id for `context` is not found in the catalog, and a fallback is specified, the request is forwarded to the fallback's ``npgettext()`` method. Otherwise, when ``num`` is 1 ``singular`` is returned, and ``plural`` is returned in all other cases. """ ctxt_msg_id = self.CONTEXT_ENCODING % (context, singular) try: tmsg = self._catalog[(ctxt_msg_id, self.plural(num))] > if self._output_charset: E AttributeError: 'Translations' object has no attribute '_output_charset' babel/support.py:412: AttributeError ______________________ TranslationsTestCase.test_pgettext ______________________ self = <tests.test_support.TranslationsTestCase testMethod=test_pgettext> def test_pgettext(self): self.assertEqualTypeToo('Voh', self.translations.gettext('foo')) > self.assertEqualTypeToo('VohCTX', self.translations.pgettext('foo', 'foo')) tests/test_support.py:73: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Translations: "PROJECT VERSION">, context = 'foo', message = 'foo' def pgettext(self, context, message): """Look up the `context` and `message` id in the catalog and return the corresponding message string, as an 8-bit string encoded with the catalog's charset encoding, if known. If there is no entry in the catalog for the `message` id and `context` , and a fallback has been set, the look up is forwarded to the fallback's ``pgettext()`` method. Otherwise, the `message` id is returned. """ ctxt_msg_id = self.CONTEXT_ENCODING % (context, message) missing = object() tmsg = self._catalog.get(ctxt_msg_id, missing) if tmsg is missing: if self._fallback: return self._fallback.pgettext(context, message) return message # Encode the Unicode tmsg back to an 8-bit string, if possible > if self._output_charset: E AttributeError: 'Translations' object has no attribute '_output_charset' babel/support.py:376: AttributeError =============================== warnings summary =============================== babel/messages/frontend.py:33 /builddir/build/BUILD/Babel-2.9.1/babel/messages/frontend.py:33: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils import log as distutils_log babel/numbers.py::babel.numbers.format_number babel/numbers.py::babel.numbers.format_number babel/support.py::babel.support.Format.number tests/test_numbers.py::test_format_number tests/test_numbers.py::test_format_number tests/test_support.py::test_format_number /builddir/build/BUILD/Babel-2.9.1/babel/numbers.py:352: DeprecationWarning: Use babel.numbers.format_decimal() instead. warnings.warn('Use babel.numbers.format_decimal() instead.', DeprecationWarning) -- Docs: https://docs.pytest.org/en/stable/warnings.html =========================== short test summary info ============================ FAILED tests/test_support.py::TranslationsTestCase::test_dnpgettext - Attribu... FAILED tests/test_support.py::TranslationsTestCase::test_dpgettext - Attribut... FAILED tests/test_support.py::TranslationsTestCase::test_npgettext - Attribut... FAILED tests/test_support.py::TranslationsTestCase::test_pgettext - Attribute... ============ 4 failed, 3127 passed, 5 skipped, 7 warnings in 5.62s ============= The following deprecated functions and methods are removed in the gettext module: lgettext(), ldgettext(), lngettext() and ldngettext(). Function bind_textdomain_codeset(), methods output_charset() and set_output_charset(), and the codeset parameter of functions translation() and install() are also removed, since they are only used for the l*gettext() functions. (Contributed by Dong-hee Na and Serhiy Storchaka in bpo-44235.) https://bugs.python.org/issue44235 https://docs.python.org/3.11/whatsnew/3.11.html For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/02986842-babel/ For all our attempts to build babel with Python 3.11, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/babel/ Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.11: https://copr.fedorainfracloud.org/coprs/g/python/python3.11/ Let us know here if you have any questions. Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11. A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon. We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle. Changing version to 36.
I believe babel is needed for sphinx. Let's test https://github.com/python-babel/babel/pull/835 ?
I'm aware of the upstream but I'm completely swamped right now. I believe python-sig can commit to babel so I'd be happy if someone else could add the PR + give some feedback upstream.
PR: https://src.fedoraproject.org/rpms/babel/pull-request/10
To prevent shipping babel from git snapshot, we won't merge it for now. If there is no release till Python 3.11 rebuilds we will ship it like this.
Babel was updated with an upstream fix.