missing package imp imported via future.standard_library

Bug #2102164 reported by Martin Weis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-future (Ubuntu)
New
Undecided
Unassigned

Bug Description

I use a software package that imports `standard_library` ending up in an error about the missing imp package. Package imp was deprecated and removed in python 3.12, so I guess the future package should be made aware of it?

https://github.com/PythonCharmers/python-future/issues/488
Other dependent projects removed their python2 compatibility.

See also:
https://github.com/PythonCharmers/python-future/issues/246

This pull request should already handle it, maybe the ubuntu package needs an update?
https://github.com/PythonCharmers/python-future/pull/574
https://github.com/PythonCharmers/python-future/pull/574/commits/05bc771c8d8770da5b7e82db77078e6b2fef8146

```python
Python 3.12.3 (main, Feb 4 2025, 14:48:35) [GCC 13.3.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.20.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from future import standard_library
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[1], line 1
----> 1 from future import standard_library

File /usr/lib/python3/dist-packages/future/standard_library/__init__.py:65
     63 import sys
     64 import logging
---> 65 import imp
     66 import contextlib
     67 import types

ModuleNotFoundError: No module named 'imp'
```

Distributor ID: Ubuntu
Description: Ubuntu 24.04.2 LTS
Release: 24.04
Codename: noble

LANG=C apt-cache policy python3-future
python3-future:
  Installed: 0.18.2-6ubuntu2
  Candidate: 0.18.2-6ubuntu2
  Version table:
 *** 0.18.2-6ubuntu2 500
        500 http://de.archive.ubuntu.com/ubuntu noble/universe amd64 Packages

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.