Comments (6)
these issue change depending on your geolocation,
in fact this domain produces no real output at all for me
(after the redirect to china)
python-whois]$ python
Python 3.11.2 (main, Feb 8 2023, 00:00:00) [GCC 12.2.1 20221121 (Red Hat 12.2.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import whois
>>> d = whois.query("web3gpt.com")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/mboot/DEV/00-github.com/mboot/python-whois/whois/__init__.py", line 297, in query
data = do_parse(
^^^^^^^^^
File "/home/mboot/DEV/00-github.com/mboot/python-whois/whois/_2_parse.py", line 260, in do_parse
return handleShortResponse(tld, dl, whois_str, verbose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mboot/DEV/00-github.com/mboot/python-whois/whois/_2_parse.py", line 163, in handleShortResponse
raise FailedParsingWhoisOutput(whois_str)
whois.exceptions.FailedParsingWhoisOutput: [Querying whois.verisign-grs.com]
[Redirected to whois.22.cn]
[Querying whois.22.cn]
[whois.22.cn]
from python-whois.
we actually use a try: block
https://github.com/DannyCork/python-whois/blob/master/whois/_1_query.py#L182
from python-whois.
what would you prefer in this case, a simple None response without any cause
or should we add something like the whois.query() returns None
and a additional call like last_status could return:
FailedParsingWhoisOutput (in my case) or WhoisCommandFailed (in your case)
in my test2.py program i use:
try:
testItem(d)
except whois.UnknownTld as e:
errorItem(d, e, what="UnknownTld")
except whois.FailedParsingWhoisOutput as e:
errorItem(d, e, what="FailedParsingWhoisOutput")
except whois.UnknownDateFormat as e:
errorItem(d, e, what="UnknownDateFormat")
except whois.WhoisCommandFailed as e:
errorItem(d, e, what="WhoisCommandFailed")
except whois.WhoisQuotaExceeded as e:
errorItem(d, e, what="WhoisQuotaExceeded")
except whois.WhoisPrivateRegistry as e:
errorItem(d, e, what="WhoisPrivateRegistry")
except whois.WhoisCommandTimeout as e:
errorItem(d, e, what="WhoisCommandTimeout")
```
from python-whois.
I am not sure.
In my opinion, the service for getting basic information should be stable.
For .com, I think the first step is
whois -h whois.verisign-grs.com web3gpt.com
to get the basic information, and the second step is
whois -h whois.22.cn web3gpt.com
Even if the second step fails, it should return the main information already obtained in the first step.
from python-whois.
Well that happens all inside the cli whois command and is different on mac then on linux.
on Mac the cli whois has a tendency to show all steps of the redirect,
on Linux the cli whois only shows the final redirect result.
I have no influence on the behavior of how the cli whois does its work,
all we can do is ignore the error code of whois and do our best to parse the result if there is any,
for the ignore error code we already have a option on whois.query
example with your command above (on linux fedora 37):
whois -h whois.verisign-grs.com web3gpt.com
[Querying whois.verisign-grs.com]
[Redirected to whois.22.cn]
[Querying whois.22.cn]
[whois.22.cn]
whois -h whois.22.cn web3gpt.com
[Querying whois.22.cn]
[whois.22.cn]
from python-whois.
#306 add a simple way to ignore the error.
Will close it.
from python-whois.
Related Issues (20)
- FileNotFoundError: [Errno 2] No such file or directory: 'whois': 'whois' HOT 3
- Module doesn't work in python 3.5.3 HOT 3
- The pypi version is not same as the github version (0.9.27), has "we have " prompt under _0_init_tld.py HOT 7
- org.uk, gov.uk need fixed HOT 6
- fyi HOT 1
- Support for additional missing TLDs (.gt, .my, .za, .ch) HOT 4
- Most new registered domains has no updated time, Parse error HOT 6
- any idea about adding params: available, expired, pendingDelete HOT 5
- Code in documentation didn't work HOT 2
- .se updated date parsing error HOT 2
- Whois on IP HOT 3
- status whois on pipy HOT 1
- Check if domain is available, not available or in redemption period HOT 8
- cmd parameter not being passed to do_query() HOT 2
- Proposal to Archive the repo HOT 11
- Add a redis cache HOT 3
- Can't fetch domain info in .ag zone. HOT 4
- unable to lookup .pro domains HOT 4
- Can I do unlimited requests? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-whois.