erdiaker / torrequest

Simple Python interface for HTTP(s) requests over Tor
235 stars 42 forks source link

SocketClosed issue #13

Open neowulf opened 4 years ago

neowulf commented 4 years ago

I occasionally see this error in my logs even though the request completes:

 INFO - Error while receiving a control message (SocketClosed): received exception "read of closed file"

The calling code looks like this:

  with TorRequest() as tr:
    logger.debug("making request")
    response = tr.get(url)
    logger.debug("got response")
    # error happens here
    ...
  1. Is it better to have the tor daemon running rather than having it be invoked by the script?
  2. Certainly seems to be a benign issue and I suspect it's happening when the tor session is being torn down. How do I debug this issue or squelch this message?

I'd greatly appreciate any help or pointers! Thanks!