[issue31520] ResourceWarning: unclosed warning

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: I'm not confortable to expose the value of the private _io_refs attribute in repr(socket.socket). I'm not sure that anything should really be done here. I close the issue. -- resolution: -> out of date stage: -> resolved status: open -> closed

[issue31520] ResourceWarning: unclosed warning

2017-09-25 Thread STINNER Victor
STINNER Victor added the comment: > I’m curious how you manage to trigger the warning in the “closed” state. It comes from Refleak buildbots. Example: 0:13:47 load avg: 3.24 [ 52/407] test_urllib2net passed (239 sec) beginning 6 repetitions 123456 Resource 'http://www.imdb.com' is not available

[issue31520] ResourceWarning: unclosed warning

2017-09-25 Thread Martin Panter
Martin Panter added the comment: I’m curious how you manage to trigger the warning in the “closed” state. The Python I have handy is half a year out of date, but all my attempts to trigger the warning either produce the less confusing version, ResourceWarning: unclosed or there is no warning

[issue31520] ResourceWarning: unclosed warning

2017-09-25 Thread STINNER Victor
STINNER Victor added the comment: socket.SocketIO inherits from io.RawIOBase which inherits from io.IOBase. io.IOBase has a finalizer which calls the close() method. I tried to add a __del__ method to socket.SocketIO, but the object was already closed by the finalizer. io.FileIO uses a trick

[issue31520] ResourceWarning: unclosed warning

2017-09-19 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +martin.panter ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue31520] ResourceWarning: unclosed warning

2017-09-19 Thread STINNER Victor
New submission from STINNER Victor: _socket.socket object destructor emits a ResourceWarning if the socket is not closed. The problem is this warning: build/Lib/contextlib.py:60: ResourceWarning: unclosed self.gen = func(*args, **kwds) The message says "unclosed" and "closed" in the same