File tree 3 files changed +7
-2
lines changed 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -2431,8 +2431,8 @@ def log_message(self, *args):
2431
2431
class DocServer (http .server .HTTPServer ):
2432
2432
2433
2433
def __init__ (self , port , callback ):
2434
- self .host = ( sys . platform == 'mac' ) and '127.0.0.1' or 'localhost'
2435
- self .address = ('' , port )
2434
+ self .host = 'localhost'
2435
+ self .address = (self . host , port )
2436
2436
self .callback = callback
2437
2437
self .base .__init__ (self , self .address , self .handler )
2438
2438
self .quit = False
Original file line number Diff line number Diff line change @@ -510,6 +510,8 @@ def my_url_handler(url, content_type):
510
510
return text
511
511
512
512
serverthread = pydoc ._start_server (my_url_handler , port = 0 )
513
+ self .assertIn ('localhost' , serverthread .docserver .address )
514
+
513
515
starttime = time .time ()
514
516
timeout = 1 #seconds
515
517
Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ What's New in Python 3.2.6?
10
10
Library
11
11
-------
12
12
13
+ - Issue #22421: Fix a regression that caused the pydoc server to be bound to
14
+ all interfaces instead of only localhost.
15
+
13
16
- Issue #22419: Limit the length of incoming HTTP request in wsgiref server to
14
17
65536 bytes and send a 414 error code for higher lengths. Patch contributed
15
18
by Devin Cook.
You can’t perform that action at this time.
0 commit comments