File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1725,14 +1725,21 @@ def _bind_http_server_tcp(self):
17251725 try :
17261726 self .http_server .listen (port , self .ip )
17271727 except socket .error as e :
1728+ eacces = (errno .EACCES , getattr (errno , 'WSAEACCES' , errno .EACCES ))
1729+ if sys .platform == 'cygwin' :
1730+ # Cygwin has a bug that causes EPERM to be returned in this
1731+ # case instead of EACCES:
1732+ # https://cygwin.com/ml/cygwin/2019-04/msg00160.html
1733+ eacces += (errno .EPERM ,)
1734+
17281735 if e .errno == errno .EADDRINUSE :
17291736 if self .port_retries :
17301737 self .log .info (_ ('The port %i is already in use, trying another port.' ) % port )
17311738 else :
17321739 self .log .info (_ ('The port %i is already in use.' ) % port )
17331740 continue
1734- elif e .errno in ( errno . EACCES , getattr ( errno , 'WSAEACCES' , errno . EACCES )) :
1735- self .log .warning (_ ("Permission to listen on port %i denied. " ) % port )
1741+ elif e .errno in eacces :
1742+ self .log .warning (_ ("Permission to listen on port %i denied" ) % port )
17361743 continue
17371744 else :
17381745 raise
You can’t perform that action at this time.
0 commit comments