Bug 2078518 - python-pyramid fails to build with Python 3.11: AttributeError: 'Translations' object has no attribute 'lngettext'
Summary: python-pyramid fails to build with Python 3.11: AttributeError: 'Translations...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pyramid
Version: 37
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora Infrastructure SIG
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.11
TreeView+ depends on / blocked
 
Reported: 2022-04-25 13:42 UTC by Tomáš Hrnčiar
Modified: 2023-01-14 13:05 UTC (History)
10 users (show)

Fixed In Version: python-pyramid-2.0-1.fc38
Clone Of:
Environment:
Last Closed: 2023-01-14 13:05:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github Pylons pyramid issues 3678 0 None open gettext related deprecation warnings 2022-04-25 13:42:07 UTC
Github Pylons pyramid pull 3717 0 None Merged Python 3.11 Support 2022-12-31 14:34:27 UTC

Description Tomáš Hrnčiar 2022-04-25 13:42:08 UTC
python-pyramid fails to build with Python 3.11.0a7.


======================================================================
ERROR: test_ldgettext (tests.test_i18n.TestTranslations.test_ldgettext)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyramid-1.10.5/tests/test_i18n.py", line 426, in test_ldgettext
    self.assertEqual(t.ldgettext('messages', 'foo'), b'Voh')
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/pyramid-1.10.5/src/pyramid/i18n.py", line 350, in ldgettext
    return self._domains.get(domain, self).lgettext(message)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Translations' object has no attribute 'lgettext'

======================================================================
ERROR: test_ldngettext (tests.test_i18n.TestTranslations.test_ldngettext)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyramid-1.10.5/tests/test_i18n.py", line 441, in test_ldngettext
    self.assertEqual(t.ldngettext('messages', 'foo1', 'foos1', 1), b'Voh1')
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/pyramid-1.10.5/src/pyramid/i18n.py", line 371, in ldngettext
    return self._domains.get(domain, self).lngettext(singular, plural, num)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Translations' object has no attribute 'lngettext'

----------------------------------------------------------------------
Ran 2675 tests in 4.664s

FAILED (errors=2)
Test failed: <unittest.runner.TextTestResult run=2675 errors=2 failures=0>
error: Test failed: <unittest.runner.TextTestResult run=2675 errors=2 failures=0>

The following deprecated functions and methods are removed in the gettext module: lgettext(), ldgettext(), lngettext() and ldngettext().

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/04304526-python-pyramid/

For all our attempts to build python-pyramid with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/python-pyramid/

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.

Comment 1 Miro Hrončok 2022-06-22 11:54:54 UTC
The failing tests were disabled, but I leave this open so we can actually fix it later.

Comment 2 Ben Cotton 2022-08-09 13:15:04 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.

Comment 3 Ben Beasley 2022-12-31 14:34:28 UTC
Upstream fix: https://github.com/Pylons/pyramid/pull/3717

Comment 4 Fedora Update System 2023-01-14 13:02:52 UTC
FEDORA-2023-6fa33e6cf0 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-6fa33e6cf0

Comment 5 Fedora Update System 2023-01-14 13:05:16 UTC
FEDORA-2023-6fa33e6cf0 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.