You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The application fails to start when using Python 3.11 or later due to the removal of the cgi module. The error occurs when running Headphones.py.
Steps to Reproduce
Clone the repository
Navigate to the project directory
Run the script with Python 3.11 or later
Observe the error
Observed Error
Traceback (most recent call last):
File "/Applications/Headphones/Headphones.py", line 27, in <module>
from headphones import webstart, logger
File "/Applications/Headphones/headphones/__init__.py", line 27, in <module>
import cherrypy
File "/Applications/Headphones/lib/cherrypy/__init__.py", line 68, in <module>
from ._cperror import (
...<2 lines>...
)
File "/Applications/Headphones/lib/cherrypy/_cperror.py", line 135, in <module>
from cherrypy.lib import httputil as _httputil
File "/Applications/Headphones/lib/cherrypy/lib/httputil.py", line 15, in <module>
from cgi import parse_header
ModuleNotFoundError: No module named 'cgi'
Environment
OS: macOS Sequoia 15.1
Python version: 3.11 or later
Headphones version: Latest from master branch
Possible Cause
The cgi module was removed in Python 3.11, causing the script to fail when importing parse_header.
Proposed Solutions
Update the codebase to replace from cgi import parse_header with the equivalent implementation using the email module:
Description
The application fails to start when using Python 3.11 or later due to the removal of the
cgi
module. The error occurs when runningHeadphones.py
.Steps to Reproduce
Observed Error
Environment
master
branchPossible Cause
The
cgi
module was removed in Python 3.11, causing the script to fail when importingparse_header
.Proposed Solutions
from cgi import parse_header
with the equivalent implementation using theemail
module:README.md
and explicitly state support for Python versions prior to 3.11.Additional Context
Switching to Python 3.10 resolves the issue temporarily, but long-term compatibility with Python 3.11+ would enhance the user experience.
Thank you! ✌️
The text was updated successfully, but these errors were encountered: