mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Issue #23881: urllib.request.ftpwrapper constructor now closes the socket if
the FTP connection failed to fix a ResourceWarning.
This commit is contained in:
parent
fe508d1592
commit
ab73e65032
2 changed files with 8 additions and 1 deletions
|
@ -2240,7 +2240,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
|
||||
|
|
|
@ -24,6 +24,9 @@ Core and Builtins
|
|||
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
|
||||
returns bool. tkinter.BooleanVar now validates input values (accepted bool,
|
||||
int, str, and Tcl_Obj). tkinter.BooleanVar.get() now always returns bool.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue