summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2012-07-07 21:29:58 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2012-07-07 21:29:58 (GMT)
commita5e0eaf2e1151b0e800809422a2c567efad9d556 (patch)
treec6855d94e166d69b3456fb7df52f207c4b55add1 /Lib
parentbc1a7ddc9b3840e0f5c04e4253b7cfcb25d9fb69 (diff)
downloadcpython-a5e0eaf2e1151b0e800809422a2c567efad9d556.zip
cpython-a5e0eaf2e1151b0e800809422a2c567efad9d556.tar.gz
cpython-a5e0eaf2e1151b0e800809422a2c567efad9d556.tar.bz2
Fix 5931 - Python runtime hardcoded in wsgiref.simple_server - Now it specifies an implementation specific term.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_wsgiref.py10
-rw-r--r--Lib/wsgiref/simple_server.py3
2 files changed, 10 insertions, 3 deletions
diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py
index a08f66b..398c53a 100644
--- a/Lib/test/test_wsgiref.py
+++ b/Lib/test/test_wsgiref.py
@@ -9,6 +9,8 @@ from wsgiref.simple_server import WSGIServer, WSGIRequestHandler, demo_app
from wsgiref.simple_server import make_server
from io import StringIO, BytesIO, BufferedReader
from socketserver import BaseServer
+from platform import python_implementation
+
import os
import re
import sys
@@ -129,9 +131,11 @@ def compare_generic_iter(make_it,match):
class IntegrationTests(TestCase):
def check_hello(self, out, has_length=True):
+ pyver = (python_implementation() + "/" +
+ sys.version.split()[0])
self.assertEqual(out,
("HTTP/1.0 200 OK\r\n"
- "Server: WSGIServer/0.2 Python/"+sys.version.split()[0]+"\r\n"
+ "Server: WSGIServer/0.2 " + pyver +"\r\n"
"Content-Type: text/plain\r\n"
"Date: Mon, 05 Jun 2006 18:49:54 GMT\r\n" +
(has_length and "Content-Length: 13\r\n" or "") +
@@ -185,9 +189,11 @@ class IntegrationTests(TestCase):
out, err = run_amock(validator(app))
self.assertTrue(err.endswith('"GET / HTTP/1.0" 200 4\n'))
ver = sys.version.split()[0].encode('ascii')
+ py = python_implementation().encode('ascii')
+ pyver = py + b"/" + ver
self.assertEqual(
b"HTTP/1.0 200 OK\r\n"
- b"Server: WSGIServer/0.2 Python/" + ver + b"\r\n"
+ b"Server: WSGIServer/0.2 "+ pyver + b"\r\n"
b"Content-Type: text/plain; charset=utf-8\r\n"
b"Date: Wed, 24 Dec 2008 13:29:32 GMT\r\n"
b"\r\n"
diff --git a/Lib/wsgiref/simple_server.py b/Lib/wsgiref/simple_server.py
index af82f95..a6015fb 100644
--- a/Lib/wsgiref/simple_server.py
+++ b/Lib/wsgiref/simple_server.py
@@ -14,13 +14,14 @@ from http.server import BaseHTTPRequestHandler, HTTPServer
import sys
import urllib.parse
from wsgiref.handlers import SimpleHandler
+from platform import python_implementation
__version__ = "0.2"
__all__ = ['WSGIServer', 'WSGIRequestHandler', 'demo_app', 'make_server']
server_version = "WSGIServer/" + __version__
-sys_version = "Python/" + sys.version.split()[0]
+sys_version = python_implementation() + "/" + sys.version.split()[0]
software_version = server_version + ' ' + sys_version