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@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to