mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-31128: Allow pydoc to bind to arbitrary hostnames (#3011)
New -n flag allow overriding localhost with custom value, for example to run from containers.
This commit is contained in:
parent
ccb3c7654c
commit
6a396c9807
5 changed files with 39 additions and 19 deletions
|
@ -909,8 +909,8 @@ class PydocServerTest(unittest.TestCase):
|
|||
text = 'the URL sent was: (%s, %s)' % (url, content_type)
|
||||
return text
|
||||
|
||||
serverthread = pydoc._start_server(my_url_handler, port=0)
|
||||
self.assertIn('localhost', serverthread.docserver.address)
|
||||
serverthread = pydoc._start_server(my_url_handler, hostname='0.0.0.0', port=0)
|
||||
self.assertIn('0.0.0.0', serverthread.docserver.address)
|
||||
|
||||
starttime = time.time()
|
||||
timeout = 1 #seconds
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue