I try to patch a library to catch [Errno 32] Broken pipe
.
The library is coded to run in Python 2 and Python 3. In Python 2 the exception is a
socket.error: [Errno 32] Broken pipe
in Python >= 3.3 it is a
BrokenPipeError: [Errno 32] Broken pipe
In Python 3.2 there is no BrokenPipeError
implemented. There is a socket.error
but it has quite a different description than in Python 2.
I have Debian Stretch installed on my system so it seems difficult to install Python 3.2 to check, which exception I would have to catch in this version. Still, I don't want to break the library in Python 3.2.
Therefore it would be very helpful if you could tell me which is the most specific exception to catch a broken pipe error in Python 3.2.