Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5fb313b

Browse files
committed
Merged revisions 80226 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r80226 | giampaolo.rodola | 2010-04-19 23:46:28 +0200 (lun, 19 apr 2010) | 1 line Fix Issue #4841: timeout is now applied for connections resulting from PORT/EPRT commands ........
1 parent 10a51af commit 5fb313b

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

Lib/ftplib.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ def makeport(self):
297297
resp = self.sendport(host, port)
298298
else:
299299
resp = self.sendeprt(host, port)
300+
if self.timeout is not _GLOBAL_DEFAULT_TIMEOUT:
301+
sock.settimeout(self.timeout)
300302
return sock
301303

302304
def makepasv(self):
@@ -349,6 +351,8 @@ def ntransfercmd(self, cmd, rest=None):
349351
if resp[0] != '1':
350352
raise error_reply(resp)
351353
conn, sockaddr = sock.accept()
354+
if self.timeout is not _GLOBAL_DEFAULT_TIMEOUT:
355+
conn.settimeout(self.timeout)
352356
if resp[:3] == '150':
353357
# this is conditional in case we received a 125
354358
size = parse150(resp)

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ C-API
318318
Library
319319
-------
320320

321+
- Issue #4814: timeout parameter is now applied also for connections resulting
322+
from PORT/EPRT commands.
323+
321324
- Issue #8463: added missing reference to bztar in shutil's documentation.
322325

323326
- Issue #7154: urllib.request can now detect the proxy settings on OSX 10.6

0 commit comments

Comments
 (0)