Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning in wsgi-loader.py: imp module is deprecated in favor of importlib #2501

Closed
rongxin-liu opened this issue Oct 1, 2023 · 1 comment
Milestone

Comments

@rongxin-liu
Copy link
Contributor

rongxin-liu commented Oct 1, 2023


Issue report

Fill in as much as possible so that we can understand, find and fix the problem.

Are you sure this is a bug in Passenger?
Yes. I'm seeing this deprecation warning in my server running Passenger:

/usr/share/passenger/helper-scripts/wsgi-loader.py:26: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
  import sys, os, re, imp, threading, signal, traceback, socket, select, struct, logging, errno

This is the line of the code that caused the warning:
https://github.com/phusion/passenger/blob/stable-6.0/src/helper-scripts/wsgi-loader.py#L26

Question 1: What is the problem?
It appears that the wsgi-loader.py helper scripts is importing a deprecated python module imp, which is slated for removal in Python 3.12. Python 3.12 will be release tomorrow (October 2, 2023).

Question 2: Passenger version and integration mode:
Open source 6.0.18 standalone

Question 3: OS or Linux distro, platform (including version):
Ubuntu 22.04 Jammy

Question 4: Passenger installation method:

Your answer:
[ ] RubyGems + Gemfile
[ ] RubyGems, no Gemfile
[X] Phusion APT repo
[ ] Phusion YUM repo
[ ] OS X Homebrew
[ ] source tarball
[ ] Other, please specify:

Question 5: Your app's programming language (including any version managers) and framework (including versions):
Python 3.11.

Question 6: Are you using a PaaS and/or containerization? If so which one?
N/A

Question 7: Anything else about your setup that we should know?
N/A


We strive for quality and appreciate you taking the time to submit a report! Please note that if you want guaranteed response times and priority issue support we encourage you to join our enterprise customer base. They also provide us with the means to continue our high level of open source support!

@CamJN CamJN added this to the 6.0.19 milestone Oct 8, 2023
@gabefair
Copy link

image

Python 3.12 no longer has the imp module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants