Closed come-maiz closed 2 years ago
Hello!
I'm getting a warning about the socket being unclosed. I'm using requests_unixsocket.Session() in a context manager, so I was expecting it to be closed for me.
requests_unixsocket.Session()
To reproduce:
$ python3 >>> import requests_unixsocket >>> import warnings >>> warnings.simplefilter('default') >>> with requests_unixsocket.Session() as session: ... snap_info = session.get('http+unix://%2Frun%2Fsnapd.socket/v2/snaps/core') ... __main__:2: ResourceWarning: unclosed <socket.socket fd=4, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0, raddr=/run/snapd.socket>
$ lsb_release -d Description: Ubuntu 16.04.3 LTS $ python3 --version Python 3.5.2 $ pip list | grep requests-unixsocket requests-unixsocket (0.1.5)
I believe this was fixed by https://github.com/msabramo/requests-unixsocket/pull/28.
Try upgrading to the newly released 0.2.0 and see if that resolves this issue.
Closing due to inactivity
Hello!
I'm getting a warning about the socket being unclosed. I'm using
requests_unixsocket.Session()
in a context manager, so I was expecting it to be closed for me.To reproduce: