0

I am experimenting with a simple WSGI web serve like:

from flup.server.fcgi import WSGIServer
import sys, os

def app(environ, start_response):
    start_response('200 OK', [('Content-Type', 'text/html')])

    yield '<h1>FastCGI Environment</h1>'
    yield '<table>'
    for k, v in sorted(environ.items()):
         yield '<tr><th>{0}</th><td>{1}</td></tr>'.format(
         escape(k), escape(v))
    yield '</table>'


if __name__ == '__main__':
    WSGIServer(app).run()

I am getting this error: Traceback (most recent call last): File "test.py", line 19, in <module> WSGIServer(app).run() File "C:\Anaconda2\lib\site-packages\flup\server\fcgi.py", line 112, in run sock = self._setupSocket() File "C:\Anaconda2\lib\site-packages\flup\server\fcgi_base.py", line 978, in _setupSocket sock = socket.fromfd(FCGI_LISTENSOCK_FILENO, socket.AF_INET, AttributeError: 'module' object has no attribute 'fromfd'

What does this mean?

John Mutuma
  • 3,150
  • 2
  • 18
  • 31
  • Can you post the full stack trace? You don't use `fromfd` in your example. Is it the `os` module? That can happen if you have your own `os.py` file in the local directory. You could `print(os.__file__)` to see what it is. – tdelaney Mar 29 '17 at 03:18
  • Looks like `fromfd` is from `flup` – John Mutuma Mar 29 '17 at 12:26
  • `Traceback (most recent call last): File "test.py", line 19, in WSGIServer(app).run() File "C:\Anaconda2\lib\site-packages\flup\server\fcgi.py", line 112, in run sock = self._setupSocket() File "C:\Anaconda2\lib\site-packages\flup\server\fcgi_base.py", line 978, in _setupSocket sock = socket.fromfd(FCGI_LISTENSOCK_FILENO, socket.AF_INET, AttributeError: 'module' object has no attribute 'fromfd'` @tdelaney – John Mutuma Mar 29 '17 at 16:43
  • It helps to put that in the question as a code block so we can read it more easily! – tdelaney Mar 29 '17 at 16:44

0 Answers0