[New-bugs-announce] [issue5931] Python runtime name hardcoded in wsgiref.simple_server
Thijs Triemstra
report at bugs.python.org
Tue May 5 01:11:05 CEST 2009
New submission from Thijs Triemstra <lists at collab.nl>:
While testing the following script on Jython 2.5b4 I noticed it returned
SERVER_SOFTWARE = 'WSGIServer/0.1 Python/2.5b4+' instead of the expected
'WSGIServer/0.1 Jython/2.5b4+'. This is because the word 'Python' is
hardcoded in simple_server.py; "sys_version = "Python/" +
sys.version.split()[0]". I suggest using the real name of the runtime
instead of hardcoding it.
from wsgiref.simple_server import make_server, demo_app
httpd = make_server('', 8000, demo_app)
print "Serving HTTP on port 8000..."
# Respond to requests until process is killed
httpd.serve_forever()
# Alternative: serve one request, then exit
httpd.handle_request()
----------
components: Library (Lib)
messages: 87190
nosy: thijs
severity: normal
status: open
title: Python runtime name hardcoded in wsgiref.simple_server
type: behavior
versions: Python 2.5
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5931>
_______________________________________
More information about the New-bugs-announce
mailing list