Commit ab73e650 authored by Victor Stinner's avatar Victor Stinner

Issue #23881: urllib.request.ftpwrapper constructor now closes the socket if

the FTP connection failed to fix a ResourceWarning.
parent fe508d15
...@@ -2240,7 +2240,11 @@ class ftpwrapper: ...@@ -2240,7 +2240,11 @@ class ftpwrapper:
self.timeout = timeout self.timeout = timeout
self.refcount = 0 self.refcount = 0
self.keepalive = persistent self.keepalive = persistent
self.init() try:
self.init()
except:
self.close()
raise
def init(self): def init(self):
import ftplib import ftplib
......
...@@ -24,6 +24,9 @@ Core and Builtins ...@@ -24,6 +24,9 @@ Core and Builtins
Library Library
------- -------
- Issue #23881: urllib.request.ftpwrapper constructor now closes the socket if
the FTP connection failed to fix a ResourceWarning.
- Issue #15133: _tkinter.tkapp.getboolean() now supports Tcl_Obj and always - Issue #15133: _tkinter.tkapp.getboolean() now supports Tcl_Obj and always
returns bool. tkinter.BooleanVar now validates input values (accepted bool, returns bool. tkinter.BooleanVar now validates input values (accepted bool,
int, str, and Tcl_Obj). tkinter.BooleanVar.get() now always returns bool. int, str, and Tcl_Obj). tkinter.BooleanVar.get() now always returns bool.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment