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

connection failed.
This commit is contained in:
Victor Stinner 2015-04-07 12:47:57 +02:00
parent d27bcbd706
commit 5ab1c01bfd
2 changed files with 8 additions and 1 deletions

View File

@ -871,7 +871,11 @@ class ftpwrapper:
self.timeout = timeout
self.refcount = 0
self.keepalive = persistent
self.init()
try:
self.init()
except:
self.close()
raise
def init(self):
import ftplib

View File

@ -21,6 +21,9 @@ Core and Builtins
Library
-------
- Issue #23881: urllib.ftpwrapper constructor now closes the socket if the FTP
connection failed.
- Issue #15133: _tkinter.tkapp.getboolean() now supports long and Tcl_Obj and
always returns bool. tkinter.BooleanVar now validates input values (accepted
bool, int, long, str, unicode, and Tcl_Obj). tkinter.BooleanVar.get() now