msabramo / requests-unixsocket

Use requests to talk HTTP via a UNIX domain socket
Apache License 2.0
207 stars 29 forks source link

Close socket on deletion #28

Closed RantyDave closed 7 years ago

RantyDave commented 7 years ago

(bash was complaining)

msabramo commented 7 years ago

Thanks for the contribution!

What do you mean "bash was complaining"? I just want to see how to reproduce the problem, so I can test for it.

msabramo commented 7 years ago

@RantyDave: Maybe this is what you meant?

(requests-unixsocket) vagrant@vagrant:/vagrant$ python3.5 -Wall sample.py
{
    "Mirrors": null,
    "InsecureRegistryCIDRs": [
        "127.0.0.0/8"
    ],
    "IndexConfigs": {
        "docker.io": {
            "Mirrors": null,
            "Official": true,
            "Secure": true,
            "Name": "docker.io"
        }
    }
}
sys:1: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0, raddr=/var/run/docker.sock>

?

msabramo commented 7 years ago

Thanks, @RantyDave! Your fix makes the ResourceWarning warning go away for me on Python 3.5.2, so I'm going to merge this.

Thanks!