Remove duplicate dict key and except block
MODIFY
src/urllib3/fields.py
src/urllib3/fields.py
@@ -65,7 +65,6 @@ _HTML5_REPLACEMENTS = {
u"\u0022": u"%22",
# Replace "\" with "\\".
u"\u005C": u"\u005C\u005C",
- u"\u005C": u"\u005C\u005C",
}
# All control characters from 0x00 to 0x1F *except* 0x1B.

MODIFY
src/urllib3/util/ssl_.py
src/urllib3/util/ssl_.py
from __future__ import absolute_import
-import errno
import warnings
import hmac
import os
@@ -349,14 +348,8 @@ def ssl_wrap_socket(
if ca_certs or ca_cert_dir or ca_cert_data:
try:
context.load_verify_locations(ca_certs, ca_cert_dir, ca_cert_data)
- except IOError as e: # Platform-specific: Python 2.7
+ except (IOError, OSError) as e:
raise SSLError(e)
- # Py33 raises FileNotFoundError which subclasses OSError
- # These are not equivalent unless we check the errno attribute
- except OSError as e: # Platform-specific: Python 3.3 and beyond
- if e.errno == errno.ENOENT:
- raise SSLError(e)
- raise
elif ssl_context is None and hasattr(context, "load_default_certs"):
# try to load OS default certs; works well on Windows (require Python3.4+)

Remove duplicate dict key and except block