This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: socket._fileobject._getclosed() returns wrong value
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: gigamorph
Priority: normal Keywords:

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

Messages (2)
msg20324 - (view) Author: June Kim (gigamorph) Date: 2004-03-26 21:33
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?



msg20325 - (view) Author: June Kim (gigamorph) Date: 2004-03-29 19:14
Logged In: YES 
user_id=1007376

Duplicate, resolved in #924242.
History
Date User Action Args
2022-04-11 14:56:03adminsetgithub: 40086
2004-03-26 21:33:23gigamorphcreate