Issue 924242: socket._fileobject._getclosed() returns wrong value (original) (raw)

Issue924242

Created on 2004-03-26 22:03 by gigamorph, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg20326 - (view) Author: June Kim (gigamorph) Date: 2004-03-26 22:03
In socket.py, _getclosed() is defined as follows: class _fileobject(object) # ... def _getclosed(self): return self._sock is not None Which causes the following interaction: >>> import socket >>> s = socket.socket() >>> f = s.makefile() >>> f.closed True >>> f.close() >>> f.closed False Shouldn't the values of f.closed the opposite of the above?
msg20327 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-03-28 02:05
Logged In: YES user_id=31435 Why did you change the status from Open to Deleted? Changed back to Open.
msg20328 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-03-28 02:33
Logged In: YES user_id=31435 I agree the .closed property always returned the wrong result. Fixed, in lib/socket.py; new revision: 1.43 lib/test/test_socket.py; new revision: 1.68
History
Date User Action Args
2022-04-11 14:56:03 admin set github: 40087
2004-03-26 22:03:11 gigamorph create