mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue #24902: Print server URL on http.server startup
Initial patch by Felix Kaiser.
This commit is contained in:
parent
955bc38b16
commit
3a31cca4ab
2 changed files with 5 additions and 1 deletions
|
@ -1177,7 +1177,8 @@ def test(HandlerClass=BaseHTTPRequestHandler,
|
||||||
HandlerClass.protocol_version = protocol
|
HandlerClass.protocol_version = protocol
|
||||||
with ServerClass(server_address, HandlerClass) as httpd:
|
with ServerClass(server_address, HandlerClass) as httpd:
|
||||||
sa = httpd.socket.getsockname()
|
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:
|
try:
|
||||||
httpd.serve_forever()
|
httpd.serve_forever()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|
|
@ -256,6 +256,9 @@ Core and Builtins
|
||||||
Library
|
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
|
- Issue #25788: fileinput.hook_encoded() now supports an "errors" argument
|
||||||
for passing to open. Original patch by Joseph Hackman.
|
for passing to open. Original patch by Joseph Hackman.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue