Removing temporary files when not proxing inside urls utils (#35583)
This commit is contained in:
parent
684e953b50
commit
fe067040d1
1 changed files with 14 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue