Edgewall Software
Modify

#13591 closed defect (worksforme)

fcgi not working - trac 1.5.4 + lighttpd + python 3.10

Reported by: anonymous Owned by:
Priority: normal Milestone:
Component: web frontend Version:
Severity: normal Keywords: fcgi
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

fcgi doesn't work out-of-the-box in trac 1.5.4 + lighttpd + python 3.10 due to a dud import line.

Here's a patch that fixes it.

--- /home/pkg/build/trac/Trac-1.5.4/trac/web/fcgi_frontend.py	2023-02-13 12:43:52.000000000 +1100
+++ /usr/lib/python3.10/site-packages/trac/web/fcgi_frontend.py	2023-04-11 07:01:24.119796597 +1000
@@ -48,7 +48,7 @@
         dispatch_request = FlupMiddleware(dispatch_request)
 
 if not use_flup:
-    from ._fcgi import WSGIServer
+    from _fcgi import WSGIServer
 
 def run():
     WSGIServer(dispatch_request, **params).run()

Attachments (0)

Change History (2)

in reply to:  description comment:1 by Jun Omae, 19 months ago

Component: generalweb frontend
Keywords: python3.10 removed

Replying to anonymous:

fcgi doesn't work out-of-the-box in trac 1.5.4 + lighttpd + python 3.10 due to a dud import line.

Here's a patch that fixes it.

-    from ._fcgi import WSGIServer
+    from _fcgi import WSGIServer

Weird. I don't think the patch fixes it.

from ._fcgi import WSGIServer is a relative import from trac/web/fcgi_frontend.py and source:/trunk/trac/web/_fcgi.py is imported.

After the patch, from _fcgi import WSGIServer is an absolute import and _fcgi.py in sys.path is required.

$ python3.10 -c 'import _fcgi'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named '_fcgi'

comment:2 by Jun Omae, 19 months ago

Resolution: worksforme
Status: newclosed

That's an InstallationIssue. Works for me (verified with lighttpd 1.4.55, Trac 1.5.4 and Python 3.10).

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.