[issue808164] socket.close() doesn't play well with __del__

2010-08-31 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Fixed in r84380 and r84382. -- keywords: -needs review resolution: -> accepted stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___

[issue808164] socket.close() doesn't play well with __del__

2010-08-18 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Added file: http://bugs.python.org/file18571/issue808164-py3k.patch ___ Python tracker ___ ___ Python-bugs-list

[issue808164] socket.close() doesn't play well with __del__

2010-08-18 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Here is the py3k version of the patch -- ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue808164] socket.close() doesn't play well with __del__

2010-08-18 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- keywords: +needs review, patch stage: unit test needed -> patch review Added file: http://bugs.python.org/file18570/issue808164-27.patch ___ Python tracker

[issue808164] socket.close() doesn't play well with __del__

2010-08-18 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I suspect that it's not possible. I'm uploading patches that fix the .close method to avoid referencing globals that might be None during interpreter shutdown. Since the .close method has changed significantly in py3k, I'm uploading separate patches for py

[issue808164] socket.close() doesn't play well with __del__

2010-08-18 Thread Mark Lawrence
Mark Lawrence added the comment: Can someone reply to Daniel Stutzbach's query in msg104541, thanks. -- nosy: +BreamoreBoy ___ Python tracker ___ __

[issue808164] socket.close() doesn't play well with __del__

2010-04-29 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: How do I write a unit test to check that socket.__del__ doesn't refer to any globals? -- ___ Python tracker ___ ___

[issue808164] socket.close() doesn't play well with __del__

2010-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Unfortunately, that can result in ugly error messages when the > interpreter is exiting. The classical solution is to early bind the necessary globals to argument defaults, such as: def __del__(self, _socketclose=_socketclose): _socketclose(self.

[issue808164] socket.close() doesn't play well with __del__

2010-04-27 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: The purpose of calling .close() in __del__ is to close the socket when the owner is destroyed yet the program is still running. This prevents the socket from staying open if some other part of the program has somehow acquired a reference to it. telnetlib,

[issue808164] socket.close() doesn't play well with __del__

2010-04-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, realistically, if you have open sockets at shutdown, there isn't a big difference between closing and not closing them. They will be reaped with the process anyway. -- nosy: +pitrou ___ Python tracker

[issue808164] socket.close() doesn't play well with __del__

2010-04-27 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- assignee: -> stutzbach versions: +Python 2.7, Python 3.2 -Python 2.5 ___ Python tracker ___ ___ Pyt

[issue808164] socket.close() doesn't play well with __del__

2009-05-16 Thread test...@smail.ee
test...@smail.ee added the comment: The same is happened when you are trying to close pycurl handler at __del__ method. -- nosy: +test157 versions: +Python 2.5 -Python 2.6, Python 2.7, Python 3.0, Python 3.1 ___ Python tracker

[issue808164] socket.close() doesn't play well with __del__

2009-03-31 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Daniel, _closedsocket is a global, so it isn't safe to be used within __del__ during shutdown. In the py3k branch, socket.__del__ calls socket._real_close which references the global _socket. So it's not safe their, either. -- nosy: +stutzbach vers

[issue808164] socket.close() doesn't play well with __del__

2009-02-14 Thread Daniel Diniz
Daniel Diniz added the comment: Current code is: def close(self): self._sock = _closedsocket() dummy = self._sock._dummy for method in _delegate_methods: setattr(self, method, dummy) close.__doc__ = _realsocket.close.__doc__ It sure seems to be tryin

[issue808164] socket.close() doesn't play well with __del__

2008-01-20 Thread Christian Heimes
Changes by Christian Heimes: -- components: +Extension Modules -Library (Lib) type: -> behavior versions: +Python 2.6 -Python 2.3 Tracker <[EMAIL PROTECTED]> _