[Python-Dev] [Python-checkins] r88505 - python/branches/py3k/Lib/ftplib.py

Giampaolo Rodolà g.rodola at gmail.com
Wed Feb 23 05:41:40 CET 2011


I'll do.

2011/2/23 Victor Stinner <victor.stinner at haypocalc.com>:
> You should maybe backport this fix to Python 3.2.
>
> Le mardi 22 février 2011 à 20:24 +0100, giampaolo.rodola a écrit :
>> Author: giampaolo.rodola
>> Date: Tue Feb 22 20:24:33 2011
>> New Revision: 88505
>>
>> Log:
>> In FTP.close() method, make sure to also close the socket object, not only the file.
>>
>> Modified:
>>    python/branches/py3k/Lib/ftplib.py
>>
>> Modified: python/branches/py3k/Lib/ftplib.py
>> ==============================================================================
>> --- python/branches/py3k/Lib/ftplib.py        (original)
>> +++ python/branches/py3k/Lib/ftplib.py        Tue Feb 22 20:24:33 2011
>> @@ -589,11 +589,11 @@
>>
>>      def close(self):
>>          '''Close the connection without assuming anything about it.'''
>> -        if self.file:
>> +        if self.file is not None:
>>              self.file.close()
>> +        if self.sock is not None:
>>              self.sock.close()
>> -            self.file = self.sock = None
>> -
>> +        self.file = self.sock = None
>>
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/g.rodola%40gmail.com
>


More information about the Python-Dev mailing list