[Bug 1947425] Re: Use of deprecated 'imp' module

Launchpad Bug Tracker 1947425 at bugs.launchpad.net
Thu Dec 15 17:34:19 UTC 2022


This bug was fixed in the package apport - 2.20.11-0ubuntu82.3

---------------
apport (2.20.11-0ubuntu82.3) jammy; urgency=medium

  * Replace deprecated 'imp' module (LP: #1947425)
  * Fix KeyError: 'CasperMD5json' (LP: #1964828)
  * apport-kde: Fix inverse order of choices (LP: #1967965)
  * apport-unpack: Fix ValueError: ['separator'] has no binary content
    (LP: #1889443)
  * test:
    - Mock add_gdb_info calls in KDE UI tests
    - Fix KDE UI tests if whoopsie.path is disabled
    - Fix race with progress dialog in KDE UI tests
    - Run UI KDE tests again
    - Determine source package dynamically in test_run_crash_kernel
      (LP: #1992172)

 -- Benjamin Drung <bdrung at ubuntu.com>  Thu, 24 Nov 2022 12:47:19 +0100

** Changed in: apport (Ubuntu Jammy)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apport in Ubuntu.
https://bugs.launchpad.net/bugs/1947425

Title:
  Use of deprecated 'imp' module

Status in Apport:
  Fix Released
Status in apport package in Ubuntu:
  Fix Released
Status in apport source package in Jammy:
  Fix Released

Bug description:
  Impact
  ------

  The deprecation warning is just a warning, but it clutters the output
  and can lead to misattributions in case something does not work as
  expected.

  Test Case
  ---------

  1. apt install apport
  2. Execute following command:
  python3 -Wonce -c "import apport.report"
  3. There should be no output.

  Where problems could occur
  --------------------------

  Except for changes to the test cases, _check_interpreted is the only
  consumer for the changed code. Breakage in this code paths can lead to
  wrongly assume that the crashing Python code is an interpreted script
  or not. This can lead to reports that have only ExecutablePath set
  (and not InterpreterPath).

  Original Description
  --------------------

  Code using apport/report.py will see the following warning:

  $ python3 -Wonce -c "import apport.report"
  /usr/lib/python3/dist-packages/apport/report.py:13
    /usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
      import fnmatch, glob, traceback, errno, sys, atexit, locale, imp, stat

  The 'imp' module is slated for removal in Python 3.12.
  https://github.com/python/cpython/blob/main/Lib/imp.py#L31

To manage notifications about this bug go to:
https://bugs.launchpad.net/apport/+bug/1947425/+subscriptions




More information about the foundations-bugs mailing list