You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TimeoutError has errno and strerror attributes set to None #109601
Is this a bug in how the TimeoutError is raised? Or can the attributes be None which should be documented?
importsockets=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(0.1)
try:
s.connect(("10.10.10.10", 22))
exceptOSErrorasex:
print(repr(ex))
print(f"errno is {type(ex.errno)} - {ex.errno}")
print(f"strerror is {type(ex.strerror)} - {ex.strerror}")
# But the `FileNotFoundError` has the correct attributes are setimportostry:
os.listdir("non_existing_path")
exceptOSErrorasex:
print(repr(ex))
print(f"errno is {type(ex.errno)} - {ex.errno}")
print(f"strerror is {type(ex.strerror)} - {ex.strerror}")
Activity
StanFromIreland commentedon Aug 24, 2026
Partly a duplicate: #83854