Issue621180

classification
Title: module socket _udpsocket close bug
Type: Severity: normal
Components: Library Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amak, leouserz
Priority: low Keywords:

Created on 2002-10-10.08:04:39 by anonymous, last changed 2007-05-18.21:10:39 by amak.

Messages
msg751 (view) Author: Nobody/Anonymous (nobody) Date: 2002-10-10.08:04:39
Exception AttributeError: 'int' object has no 
attribute 'close' in <method _udpsocket.__del__ of 
_udpsocket instance at 4570013> ignored

I fixed it like that in socket.py

class _udpsocket:
    def close(self):
        '''
        sock = self.sock
        self.sock = 0
        sock.close()
        '''
        if self.sock:
            self.sock.close()
            self.sock = None
msg752 (view) Author: Deleted User leouserz (leouserz) Date: 2007-01-15.18:35:36
Is there a test case for this? The current implementation looks ok to me:
    def close(self):

        if not self.sock:

            return

        sock = self.sock

        self.sock = 0

        sock.close()


get rid of self.sock, then close out the local "sock".  Maybe this should just be closed?
msg753 (view) Author: Alan Kennedy (amak) Date: 2007-05-18.21:10:39
This bug should be closed; it refers to the old jython 2.1 implementation.

leouserz comment of 2007-01-15 18:35 is correct; the current implementation is OK.

(Although I have changed "self.sock = 0" to "self.sock = None" for improved style)
History
Date User Action Args
2002-10-10 08:04:39anonymouscreate