Issue 5931: Python runtime name hardcoded in wsgiref.simple_server (original) (raw)

Created on 2009-05-04 23:11 by thijs, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
wsgiref.patch thijs,2009-09-27 16:06
Messages (8)
msg87190 - (view) Author: Thijs Triemstra (thijs) Date: 2009-05-04 23:10
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()
msg93177 - (view) Author: Thijs Triemstra (thijs) Date: 2009-09-27 16:06
Here's a patch that uses platform.python_implementation instead, producing: >>> from wsgiref import simple_server >>> simple_server.software_version 'WSGIServer/0.1 CPython/2.7a0' >>> This will become relevant when Jython and IronPython start using these modules.
msg112708 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-08-03 22:21
In the absence of doc claiming the requested behavior, this is a feature request. In principle, it seems sensible, but I do not use the module. Support from more than one person, perhaps from python-list or web-sig list (not sure of name) would be good. Aside from that, patch replaces 'Python' with platform.python_implementation(). For me, that is 'CPython'. Some might prefer the binary 'python' (or whatever), so I am not this is the right replacement.
msg164862 - (view) Author: Greg Roodt (groodt) * Date: 2012-07-07 14:47
Bumping as part of bug scrub at EuroPython. Patch seems sensible to me. Obvious options to me are to either accept patch, close bug or write docs. Bug has not seen activity in years, so can probably be closed.
msg164919 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2012-07-07 18:37
Phillip, this is a trivial wsgiref patch. Do you have any opinion?
msg164942 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2012-07-07 21:33
I have fixed this in the changeset 34e705fa4da4. SERVER_SOFTWARE term can be made more specific to note the implementation as various suggestions say. I personally think, it is worthy to make change in 3.3 itself as its been open from a long time and it is strictly not a feature as such.
msg164947 - (view) Author: PJ Eby (pje) * (Python committer) Date: 2012-07-07 21:58
On Sat, Jul 7, 2012 at 2:37 PM, Terry J. Reedy wrote: > Phillip, this is a trivial wsgiref patch. Do you have any opinion? > Nope.
msg164972 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-07-08 08:11
You need to indent the block after the versionchanged directive. Also, I believe only bug fixes should go into 3.3 now that we are in beta.
History
Date User Action Args
2022-04-11 14:56:48 admin set github: 50181
2012-07-08 08:11:20 eric.araujo set nosy: + eric.araujomessages: +
2012-07-07 23:33:56 orsenthil set status: open -> closedstage: patch review -> resolvedresolution: fixedversions: + Python 3.3, - Python 3.4
2012-07-07 21:58:21 pje set messages: +
2012-07-07 21:33:20 orsenthil set nosy: + orsenthilmessages: +
2012-07-07 18:37:10 terry.reedy set messages: + versions: + Python 3.4, - Python 3.2
2012-07-07 14:47:56 groodt set nosy: + groodtmessages: +
2010-08-03 22:33:47 dstanek set nosy: + dstanek
2010-08-03 22:21:26 terry.reedy set type: behavior -> enhancementversions: + Python 3.2, - Python 2.5keywords: + easy, - patchnosy: + terry.reedymessages: + stage: patch review
2009-09-27 16:06:36 thijs set files: + wsgiref.patchkeywords: + patchmessages: +
2009-05-04 23:15:15 benjamin.peterson set assignee: pjenosy: + pje
2009-05-04 23:11:02 thijs create