mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
test: retry when write to a socket fails on macOS
If the socket is tearing down macOS will return EPROTOTYPE instead of EPIPE. Because python doesn't handle this internally we have to do a workaround and retry the request. See https://bugs.python.org/issue33450
This commit is contained in:
parent
8cf9d15b82
commit
3a7e79478a
1 changed files with 2 additions and 0 deletions
|
@ -115,6 +115,8 @@ class AuthServiceProxy():
|
|||
except OSError as e:
|
||||
retry = (
|
||||
'[WinError 10053] An established connection was aborted by the software in your host machine' in str(e))
|
||||
# Workaround for a bug on macOS. See https://bugs.python.org/issue33450
|
||||
retry = retry or ('[Errno 41] Protocol wrong type for socket' in str(e))
|
||||
if retry:
|
||||
self.__conn.close()
|
||||
self.__conn.request(method, path, postdata, headers)
|
||||
|
|
Loading…
Add table
Reference in a new issue