PEP 3151 / issue #12555: reworking the OS and IO exception hierarchy.
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 671ab68..a947608 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -1547,6 +1547,8 @@
                 return getattr(self, name)(url)
             else:
                 return getattr(self, name)(url, data)
+        except HTTPError:
+            raise
         except socket.error as msg:
             raise IOError('socket error', msg).with_traceback(sys.exc_info()[2])