summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2016-04-29 13:48:11 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2016-04-29 13:48:11 (GMT)
commit3a31cca4abdfdc4d623deb7e8c4be58b5ca936eb (patch)
tree34f72a6300558b52ee6cff23a8094103dc5a4e36
parent955bc38b16abd6f98f534337675b04f23e13124f (diff)
downloadcpython-3a31cca4abdfdc4d623deb7e8c4be58b5ca936eb.zip
cpython-3a31cca4abdfdc4d623deb7e8c4be58b5ca936eb.tar.gz
cpython-3a31cca4abdfdc4d623deb7e8c4be58b5ca936eb.tar.bz2
Issue #24902: Print server URL on http.server startup
Initial patch by Felix Kaiser.
-rw-r--r--Lib/http/server.py3
-rw-r--r--Misc/NEWS3
2 files changed, 5 insertions, 1 deletions
diff --git a/Lib/http/server.py b/Lib/http/server.py
index 1f6a62b..bd94eaa 100644
--- a/Lib/http/server.py
+++ b/Lib/http/server.py
@@ -1177,7 +1177,8 @@ def test(HandlerClass=BaseHTTPRequestHandler,
HandlerClass.protocol_version = protocol
with ServerClass(server_address, HandlerClass) as httpd:
sa = httpd.socket.getsockname()
- print("Serving HTTP on", sa[0], "port", sa[1], "...")
+ serve_message = "Serving HTTP on {host} port {port} (http://{host}:{port}/) ..."
+ print(serve_message.format(host=sa[0], port=sa[1]))
try:
httpd.serve_forever()
except KeyboardInterrupt:
diff --git a/Misc/NEWS b/Misc/NEWS
index e68bbdf..7b3bbd7 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -256,6 +256,9 @@ Core and Builtins
Library
-------
+- Issue #24902: Print server URL on http.server startup. Initial patch by
+ Felix Kaiser.
+
- Issue #25788: fileinput.hook_encoded() now supports an "errors" argument
for passing to open. Original patch by Joseph Hackman.