~ubuntu-branches/ubuntu/natty/python3.1/natty-security

« back to all changes in this revision

Viewing changes to Lib/ftplib.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-07-06 16:52:42 UTC
  • mfrom: (1.2.1 upstream) (2.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20100706165242-2xv4i019r3et6c0j
Tags: 3.1.2+20100706-1ubuntu1
* Merge with Debian; remaining changes:
  - Regenerate the control file.
  - Add debian/patches/overwrite-semaphore-check for Lucid buildds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
236
236
        if self.debugging > 1: print('*put urgent*', self.sanitize(line))
237
237
        self.sock.sendall(line, MSG_OOB)
238
238
        resp = self.getmultiline()
239
 
        if resp[:3] not in ('426', '226'):
 
239
        if resp[:3] not in ('426', '225', '226'):
240
240
            raise error_proto(resp)
241
241
 
242
242
    def sendcmd(self, cmd):
296
296
            resp = self.sendport(host, port)
297
297
        else:
298
298
            resp = self.sendeprt(host, port)
 
299
        if self.timeout is not _GLOBAL_DEFAULT_TIMEOUT:
 
300
            sock.settimeout(self.timeout)
299
301
        return sock
300
302
 
301
303
    def makepasv(self):
348
350
            if resp[0] != '1':
349
351
                raise error_reply(resp)
350
352
            conn, sockaddr = sock.accept()
 
353
            if self.timeout is not _GLOBAL_DEFAULT_TIMEOUT:
 
354
                conn.settimeout(self.timeout)
351
355
        if resp[:3] == '150':
352
356
            # this is conditional in case we received a 125
353
357
            size = parse150(resp)