Coder Social home page Coder Social logo

Comments (10)

Silverlink34 avatar Silverlink34 commented on August 31, 2024 14

I am getting the same problem - I am iterating over a list of a couple hundred domains to clean up name servers. The whois lookup results are working properly, but this error keeps popping up in my output.

I am trying to use a progress bar in my command-line application but if anything is printed during the progressbar it makes the bar continue progressing on the next line.. and the error pops up so much that my whole command window is nearly filled with the progressbar. Need to be able to suppress the output of this error if possible.

I was able to fix this issue by forcing the 'quick' flag like so: (also runs a LOT faster!!)
Note that according to the code, this skips checking for a regional whois server for local results. I'm only interested in checking if a domain has expired/isn't registered so I don't believe this will cause any issues with that sort of check.

flags = 0
flags = flags | whois.NICClient.WHOIS_QUICK
w=whois.whois(domain, flags=flags)

from whois.

svaniksharma avatar svaniksharma commented on August 31, 2024 2

I've been having this issue, but the whois request works for me. The main issue is using a print() to log the error to standard output. I don't want to see "Error trying to connect to socket: closing socket". Maybe logging it to a file or throwing an exception for the user to handle would be better?

from whois.

jryberg avatar jryberg commented on August 31, 2024

TCP communication looks different when using -h flag compared how to the imported function behaves when doing whois.whois(domain)

It seems it tries to connect to the registrar and in this case it's whois.marcaria.com that resolves to 45.60.33.228

When trying to run python3 whois.py -h 45.60.33.228.43 google.io I got something familiar back
Error trying to connect to socket: closing socket

I assume this component are trying to use registrar whois server as well? And in my case it's currently broken

from whois.

jryberg avatar jryberg commented on August 31, 2024

I received further information from Marcaria, they state they only offer whois via https and not port 43

Is there any way to fix this issue?

from whois.

mrjackson avatar mrjackson commented on August 31, 2024

I'm seeing what I think is the same error with any domains that use whois.name.com
On 0.7.2 it wouldn't work at all and output nothing, after upgrading to 0.7.3 I get the correct output along with Error trying to connect to socket: closing socket

from whois.

Silverlink34 avatar Silverlink34 commented on August 31, 2024

I am getting the same problem - I am iterating over a list of a couple hundred domains to clean up name servers. The whois lookup results are working properly, but this error keeps popping up in my output.

I am trying to use a progress bar in my command-line application but if anything is printed during the progressbar it makes the bar continue progressing on the next line.. and the error pops up so much that my whole command window is nearly filled with the progressbar. Need to be able to suppress the output of this error if possible.

from whois.

LizardBlizzard avatar LizardBlizzard commented on August 31, 2024

Getting the same issue while querying .com domains. Not sure why this is happening but is there any reason to keep the direct print statement?
It's quite inconvenient, especially with async code where you have no clue which coroutine printed the message.

from whois.

reiday avatar reiday commented on August 31, 2024

+1 to this, the messages were really unnerving at first; I was really worried my requests were failing.

from whois.

kylejohnson avatar kylejohnson commented on August 31, 2024

I just submitted a PR to address this.

from whois.

Augustin-FL avatar Augustin-FL commented on August 31, 2024

The PR of kylejohnson is nice, but it does not fix the actual issue ("Error trying to connect to socket: closing socket being displayed to stdout")
I made a new PR ( #133 ) to complete kylejohnson's work

from whois.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.