Autopkgtest regression in python3.11

Bug #2003970 reported by Olivier Gayot
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubiquity (Ubuntu)
Fix Released
Undecided
Olivier Gayot

Bug Description

Autopkgtest fails with Python 3.11 with the following exception:

ERROR: test_set_gnome_keyboard_layout_to_existing_layout (test_ubi_console_setup.TestPage.test_set_gnome_keyboard_layout_to_existing_layout)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.11/unittest/mock.py", line 1366, in patched
    with self.decoration_helper(patched,
  File "/usr/lib/python3.11/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/unittest/mock.py", line 1348, in decoration_helper
    arg = exit_stack.enter_context(patching)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/contextlib.py", line 502, in enter_context
    result = _enter(cm)
             ^^^^^^^^^^
  File "/usr/lib/python3.11/unittest/mock.py", line 1421, in __enter__
    self.target = self.getter()
                  ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/pkgutil.py", line 688, in resolve_name
    raise ValueError(f'invalid format: {name!r}')
ValueError: invalid format: 'ubi-console-setup.gsettings'

Since Python3.11, unittest.mock uses pkgutil.resolve_name which only accepts valid python module identifiers.

The change was introduced as part of:
 * github issue: https://github.com/python/cpython/issues/88852
 * github PR: https://github.com/python/cpython/pull/18544

Related branches

Olivier Gayot (ogayot)
tags: added: update-excuse
Changed in ubiquity (Ubuntu):
assignee: nobody → Olivier Gayot (ogayot)
status: New → In Progress
Olivier Gayot (ogayot)
Changed in ubiquity (Ubuntu):
status: In Progress → Confirmed
Revision history for this message
Steve Langasek (vorlon) wrote :

Uploaded, however the package failed to build in lunar: https://launchpad.net/ubuntu/+source/ubiquity/23.04.3/+build/25524478

Revision history for this message
Olivier Gayot (ogayot) wrote :

Thanks! I've had a look into the build failure on amd64.
<something> has happened during the processing of .po files but I don't know exactly what ; and I wasn't able to reproduce the issue locally nor on a PPA build.

The build got retried and failed again (still while processing .po files but at a later stage).

I've created another PR which adds more logging to the failing script.

https://code.launchpad.net/~ogayot/ubiquity/+git/ubiquity/+merge/436424

Revision history for this message
Olivier Gayot (ogayot) wrote :

I looked into it again and although the diff in my merge proposal was very small, the diff of the upload is much larger (> 4 MiB):

https://launchpadlibrarian.net/648124240/ubiquity_23.04.2_23.04.3.diff.gz

Have I done something wrong?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubiquity - 23.04.4

---------------
ubiquity (23.04.4) lunar; urgency=medium

  * mktemplates.base: add more logging to ease diagnosis for failed builds

 -- Olivier Gayot <email address hidden> Fri, 27 Jan 2023 07:47:28 -0800

Changed in ubiquity (Ubuntu):
status: Confirmed → Fix Released
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.