From: Berker Peksag Date: Fri, 29 Apr 2016 13:48:11 +0000 (+0300) Subject: Issue #24902: Print server URL on http.server startup X-Git-Tag: v3.6.0a1~97 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a31cca4abdfdc4d623deb7e8c4be58b5ca936eb;p=python Issue #24902: Print server URL on http.server startup Initial patch by Felix Kaiser. --- diff --git a/Lib/http/server.py b/Lib/http/server.py index 1f6a62bff9..bd94eaa01b 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 e68bbdf3a7..7b3bbd7866 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.