THRIFT-5595: Handle peek request error with SSLSocket
The update to TSocket in 01d53f483a7531ad4899b522060e8913dca309fb errors
for TSSLSocket with
```
ValueError: non-zero flags not allowed in calls to recv() on <class 'ssl.SSLSocket'>
```
Handles ValueError from ssl.SSLSocket to fix isOpen when using
TSSLSocket.
diff --git a/lib/py/src/transport/TSocket.py b/lib/py/src/transport/TSocket.py
index 3c7a3ca..eea5366 100644
--- a/lib/py/src/transport/TSocket.py
+++ b/lib/py/src/transport/TSocket.py
@@ -94,6 +94,9 @@
if exc.errno in (errno.EWOULDBLOCK, errno.EAGAIN):
return True
return False
+ except ValueError:
+ # SSLSocket fails on recv with non-zero flags; fallback to the old behavior
+ return True
finally:
self.handle.settimeout(original_timeout)