Removing temporary files when not proxing inside urls utils (#35583)

This commit is contained in:
acrewdson 2018-02-01 10:27:45 -05:00 committed by Sam Doran
parent 684e953b50
commit fe067040d1

View file

@ -618,6 +618,10 @@ class SSLValidationHandler(urllib_request.BaseHandler):
pass
if not to_add:
try:
os.remove(to_add_path)
except OSError:
pass
to_add_path = None
return (tmp_path, to_add_path, paths_checked)
@ -677,6 +681,16 @@ class SSLValidationHandler(urllib_request.BaseHandler):
if not use_proxy:
# ignore proxy settings for this host request
if tmp_ca_cert_path:
try:
os.remove(tmp_ca_cert_path)
except OSError:
pass
if to_add_ca_cert_path:
try:
os.remove(to_add_ca_cert_path)
except OSError:
pass
return req
try: