phusion / passenger

A fast and robust web server and application server for Ruby, Python and Node.js
https://www.phusionpassenger.com/
MIT License
5k stars 547 forks source link

Fix wsgi-loader.py incompatibility with python 3.3 and 3.4 #2523

Closed helldotcat closed 7 months ago

helldotcat commented 7 months ago

After https://github.com/phusion/passenger/pull/2502 wsgi-loader.py is incompatible with python3.3 and python 3.4. An error AttributeError: 'module' object has no attribute 'spec_from_file_location' is thrown.

$ python3
Python 3.4.10 (default, Oct  4 2023, 09:14:39) 
[GCC 8.5.0 20210514 (Red Hat 8.5.0-18)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib.util
>>> importlib.util.module_from_spec
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'module_from_spec'

spec_from_file_location was added in python3.5. I restored compatibility by making use spec_from_file_location on python3.5+.

imp module was removed in python3.12.

CamJN commented 7 months ago

Looks good, have you signed the contributor agreement?

helldotcat commented 7 months ago

Yes, I have signed

helldotcat commented 7 months ago

@CamJN Do you have an approximate ETA when it may be released?

CamJN commented 7 months ago

Not at this time, I’ve got other changes I’ve got to finish before I can make a release.