classification
Title: wsgiref.simple_server.SimpleServer claims to be multithreaded
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: djc, pje, sgala
Priority: normal Keywords:

Created on 2010-03-14 18:08 by sgala, last changed 2010-08-03 14:24 by djc.

Messages (1)
msg101058 - (view) Author: Santiago Gala (sgala) Date: 2010-03-14 18:08
In python 2.6, a server created with wsgiref.simple_server.make_server will
claim to be multithreaded and multiprocess through it wsgi environ. See  wsgi.multithread in the browser page after launching

  $ python /usr/lib/python2.6/wsgiref/simple_server.py

The bug is due to the default value in the constructor wsgiref.handlers.SimpleHandler, and it is misleading, as the servier is singlethreaded. It gives problems for any app that wants to change behavior or error on singlethreaded.

The problem can be fixed very simply by patching a "multithreaded=False" argument into the ServerHandler constructor in simple_server.
History
Date User Action Args
2010-08-03 14:24:19djcsetnosy: + djc
2010-07-12 14:19:06BreamoreBoysetnosy: + pje
2010-03-14 18:11:33sgalasettype: behavior
components: + Library (Lib)
2010-03-14 18:08:54sgalacreate