Since 6.2.0, unit test failures in Debian unstable

Bug #2055039 reported by Thomas Goirand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.i18n
New
Undecided
Unassigned

Bug Description

Hi,

Apparently, since https://review.opendev.org/c/openstack/oslo.i18n/+/873842 (not sure, but it looks like it), oslo.i18n fails to build in Debian Unstable with these 2 failures:

======================================================================
FAIL: oslo_i18n.tests.test_fixture.PrefixLazyTranslationTest.test_default
oslo_i18n.tests.test_fixture.PrefixLazyTranslationTest.test_default
----------------------------------------------------------------------
testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/oslo_i18n/tests/test_fixture.py", line 98, in test_default
    self.assertEqual(expected_msg, _translate.translate(msg1))
  File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 394, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 481, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: 'oslo_i18n/en_US: fake msg1' != 'oslo_i18n/C: fake msg1'

======================================================================
FAIL: oslo_i18n.tests.test_fixture.PrefixLazyTranslationTest.test_extra_lang
oslo_i18n.tests.test_fixture.PrefixLazyTranslationTest.test_extra_lang
----------------------------------------------------------------------
testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/oslo_i18n/tests/test_fixture.py", line 114, in test_extra_lang
    self.assertEqual(expected_msg_en_US, _translate.translate(msg1))
  File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 394, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 481, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: 'oslo_i18n/en_US: fake msg1' != 'oslo_i18n/C: fake msg1'

There's obviously something wrong with this patch. Note that I tried setting LANG=en_US when running unit tests, and it didn't help.

Cheers,

Thomas Goirand (zigo)

Revision history for this message
Takashi Kajinami (kajinamit) wrote :

This is probably an issue caused by underlying python. Can you check the following results

import locale
locale.getdefaultlocale()
locale.getlocale(locale.LC_CTYPE)

In my local env these two return identical results.

Python 3.11.7 (main, Dec 18 2023, 00:00:00) [GCC 13.2.1 20231011 (Red Hat 13.2.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.getdefaultlocale()
<stdin>:1: DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.
('en_US', 'UTF-8')
>>> locale.getlocale(locale.LC_CTYPE)
('en_US', 'UTF-8')

Revision history for this message
Thomas Goirand (thomas-goirand) wrote :

I got the same result exactly, in both Python 3.11.8 and 3.12.2.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.