cpython: 1a72c0a1a50f (original) (raw)

Mercurial > cpython

changeset 95468:1a72c0a1a50f

(Merge 3.4) Issue #23881: urllib.request.ftpwrapper constructor now closes the socket if the FTP connection failed to fix a ResourceWarning. [#23881]

Victor Stinner victor.stinner@gmail.com
date Tue, 07 Apr 2015 12:50:24 +0200
parents 9a0caf6e7a16(current diff)7b168db16e67(diff)
children 6ed381537e6c
files Lib/urllib/request.py Misc/NEWS
diffstat 2 files changed, 8 insertions(+), 1 deletions(-)[+] [-] Lib/urllib/request.py 6 Misc/NEWS 3

line wrap: on

line diff

--- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -2255,7 +2255,11 @@ class ftpwrapper: self.timeout = timeout self.refcount = 0 self.keepalive = persistent

def init(self): import ftplib

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -19,6 +19,9 @@ Core and Builtins Library ------- +- Issue #23881: urllib.request.ftpwrapper constructor now closes the socket if