Python 3.12, ModuleNotFoundError: No module named 'imp'

Bug #2049942 reported by Aaron Linville
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ruby Passenger
Fix Released
Unknown
passenger (Ubuntu)
New
Undecided
Unassigned

Bug Description

Attempting to use Passenger with Python 3.12 leads to an error "ModuleNotFoundError: No module named 'imp'" and the application fails to run. This is due to the wsgi-loader.py script distributed with Passenger using the imp module which has been deprecated since Python 3.4 and was finally removed in Python 3.12.

This was a known bug in passenger and has been fixed in Passenger 6.0.19:
Bug Report: https://github.com/phusion/passenger/issues/2501
PR Fix: https://github.com/phusion/passenger/issues/2501

Encountered this on focal, but looks like noble is also affected.

Tags: patch
Changed in ruby-passenger:
status: Unknown → Fix Released
Revision history for this message
Aaron Linville (alinville) wrote :

Attached patch that could be used to fix focal (which uses a passenger 5.0.30, which is no longer maintained upstream).

Impact:

Fixes the fatal error with Passenger / Python 3.12 but preserves existing behavior with <=3.11 (which is to just throw a warning). Compatible w/ Python 2.7 also.

Haven't tested full package yet.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "py312-uses-importlib.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
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.