changeset: 101183:3be61137280a user: Berker Peksag date: Fri Apr 29 16:48:11 2016 +0300 files: Lib/http/server.py Misc/NEWS description: Issue #24902: Print server URL on http.server startup Initial patch by Felix Kaiser. diff -r d263dcfd9bb6 -r 3be61137280a Lib/http/server.py --- a/Lib/http/server.py Fri Apr 29 14:41:41 2016 +0300 +++ b/Lib/http/server.py Fri Apr 29 16:48:11 2016 +0300 @@ -1177,7 +1177,8 @@ 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 -r d263dcfd9bb6 -r 3be61137280a Misc/NEWS --- a/Misc/NEWS Fri Apr 29 14:41:41 2016 +0300 +++ b/Misc/NEWS Fri Apr 29 16:48:11 2016 +0300 @@ -256,6 +256,9 @@ 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.