Code Monkey home page Code Monkey logo

python-whois's People

Contributors

anak10thn avatar arvidsnet avatar baigreen avatar bazzisoft avatar bochecha avatar c-goosen avatar dannycork avatar ep-hamster avatar fabrizioperesson avatar kazet avatar maarten-boot avatar mboot-github avatar mgargiullo avatar mimi89999 avatar mohitz007 avatar mrbitsdcf avatar nickmasster avatar psckiwi avatar qistoph avatar riszkymf avatar rl-devops avatar sintemal avatar skazochnik97 avatar stylesuxx avatar stypr avatar tnhung2011 avatar unggulzmalqp avatar willymwai avatar windgmbh avatar wkobes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-whois's Issues

Exception

Hi, maybe if domain free you add some diferent exception? some time have 
problem with timout exceotion and i cant catch his =(.

Original issue reported on code.google.com by [email protected] on 19 Feb 2013 at 10:44

Generic Exceptions

There are a couple of places where this library is raising exceptions that are just generic exceptions, this makes it very hard for me to see what actually happened.

I am willing to submit a PR for with the following custom exceptions:

  • UnknownTld instead of Exception
  • UnknownDateFormat instead of ValueError
  • WhoisCommandFailed insted of Exception
  • FailedParsingWhoisOutput instead of Exception

@DannyCork is this something you would be interested in merging?

Windows/Subprocess Issue (Python 3.4)

When running domain = whois.query("google.com") in a Python 3.4 program on a 64-bit Windows system, the following traceback occurs:

File "file.py", line x, in weight_sources
    domain = whois.query("google.com")
  File "C:\Users\User Name\Anaconda3\lib\site-packages\whois\__init__.py", line 50, in query
    pd = do_parse(do_query(d, force, cache_file, slow_down, ignore_returncode), tld)
  File "C:\Users\User Name\Anaconda3\lib\site-packages\whois\_1_query.py", line 44, in do_query
    _do_whois_query(dl, ignore_returncode),
  File "C:\Users\User Name\Anaconda3\lib\site-packages\whois\_1_query.py", line 58, in _do_whois_query
    p = subprocess.Popen(['whois', '.'.join(dl)], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
  File "C:\Users\User Name\Anaconda3\lib\subprocess.py", line 856, in __init__
    restore_signals, start_new_session)
  File "C:\Users\User Name\Anaconda3\lib\subprocess.py", line 1111, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

This could be a subprocess error, but subprocess works otherwise (and has been used in other programs extensively). Any thoughts welcome! Thanks!

ValueError: Unknown date format

What steps will reproduce the problem?

1. easy_install whois
Searching for whois
Reading http://pypi.python.org/simple/whois/
Best match: whois 0.7
Downloading 
https://pypi.python.org/packages/source/w/whois/whois-0.7.tar.gz#md5=01a31bcb0d0
fa3d02b7ea336a00fe4f4
Processing whois-0.7.tar.gz
Running whois-0.7/setup.py -q bdist_egg --dist-dir 
/tmp/easy_install-MbP61X/whois-0.7/egg-dist-tmp-0DuwM6
zip_safe flag not set; analyzing archive contents...
Adding whois 0.7 to easy-install.pth file

Installed /usr/lib/python2.6/site-packages/whois-0.7-py2.6.egg
Processing dependencies for whois
Finished processing dependencies for whois

2. # python
Python 2.6.6 (r266:84292, Jan 22 2014, 06:01:05) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import whois
>>> domain = whois.query('google.com')

What is the expected output? What do you see instead?

I see ValueError: Unknown date format: 


What version of the product are you using? On what operating system?
 cat /etc/redhat-release 
CloudLinux Server release 6.5 (Pavel Popovich) (It's clone CentOS 6.5)
Python 2.6.6 (r266:84292, Jan 22 2014, 06:01:05) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2

Please provide any additional information below.

 domain = whois.query('google.com')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/whois-0.7-py2.6.egg/whois/__init__.py", line 54, in query
    return Domain(pd) if pd['domain_name'][0] else None
  File "/usr/lib/python2.6/site-packages/whois-0.7-py2.6.egg/whois/_3_adjust.py", line 14, in __init__
    self.creation_date          = str_to_date(data['creation_date'][0])
  File "/usr/lib/python2.6/site-packages/whois-0.7-py2.6.egg/whois/_3_adjust.py", line 82, in str_to_date
    if PYTHON_VERSION < 3: return str_to_date_py2(s)
  File "/usr/lib/python2.6/site-packages/whois-0.7-py2.6.egg/whois/_3_adjust.py", line 100, in str_to_date_py2
    raise ValueError("Unknown date format: '%s'" % s)
ValueError: Unknown date format: '2002-10-02t00:00:00-0700'

Original issue reported on code.google.com by [email protected] on 2 Apr 2014 at 11:00

.org domains don't work

>>> import whois
>>> domain = whois.query("libravatar.org")
>>> print domain.__dict__

Instead of getting the domain's whois information, we get a backtrace and a 
null object. Same thing for all .org domains it seems.

whois 0.6.1 (installed as root using "pip install")
Debian unstable

Original issue reported on code.google.com by [email protected] on 2 Jun 2012 at 11:48

.info whois format changed

What steps will reproduce the problem?
>>> import whois
>>> w = whois.query('google.info')
>>> print w.__dict__
{'last_updated': None, 'name': 'google.info', 'expiration_date': None, 
'creation_date': None, 'registrar': 'MarkMonitor Inc. (R151-LRMS)', 
'name_servers': set(['ns3.google.com', 'name', 'ns1.google.com', 
'ns2.google.com', 'dnssec:unsigned', 'ns4.google.com'])}

What is the expected output? What do you see instead?
last_updated, expiration_date and creation_date should be populated instead of 
being set to None.


What version of the product are you using? On what operating system?

Debian 6.0.9

whois --version : Version 5.0.10.

pip show whois

---
Name: whois
Version: 0.7
Location: /usr/local/lib/python2.6/dist-packages
Patched with 12 issue https://code.google.com/p/python-whois/issues/detail?id=12

Please provide any additional information below.

Need to extend "info" section from org section after applying patch from issue 
12 on this project.

Original issue reported on code.google.com by [email protected] on 25 Feb 2014 at 8:04

Attachments:

Add .kz

There is no .kz zone (whois.nic.kz)

No support for .edu TLD?

I just tried querying a domain with .edu and got the following error:

Traceback (most recent call last):
File "./func_args.py", line 14, in
domain = whois.query('ncsa.illinois.edu')
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/whois/init.py", line 58, in query
raise UnknownTld('Unknown TLD: %s\n(all known TLD: %s)' % (tld, list(TLD_RE.keys())))
whois.exceptions.UnknownTld: Unknown TLD: edu
(all known TLD: ['com', 'at', 'uk', 'pl', 'be', 'biz', 'br', 'ca', 'cc', 'co', 'jp', 'co_jp', 'cz', 'de', 'eu', 'fr', 'id', 'info', 'io', 'it', 'ru', 'lv', 'me', 'mobi', 'mx', 'name', 'net', 'nyc', 'nz', 'online', 'org', 'press', 'pw', 'store', 'rest', 'ru_rf', 'security', 'sh', 'site', 'space', 'tech', 'tel', 'theatre', 'tickets', 'tv', 'us', 'uz', 'video', 'website', 'wiki', 'xyz'])

Can I please request support for .edu TLD to be added to the API?

Thanks!

-Kapil.

"before <date>" date entries aren't handled

All .ac.uk domains generate

whois.exceptions.UnknownDateFormat: Unknown date format: 'before aug-1996'

str_to_date_py2() in _3_adjust.py needs an additional format to handle this - I suggest adding

'before %b-%Y',                 # before aug-1996

to the DATE_FORMATS=[] definition.

.org queries return creation_date: none

Describe the bug
A query to a .org returns an object with creation_date: None even though the creation date is listed in the whois data.

To Reproduce
ans = whois.query("211.org")
ans.creation_date

None

Expected behavior

datetime.datetime(1998, 06, 19, 4, 0)

Desktop (please complete the following information):

  • OS: Ubuntu Linux 18.04
  • Python 3.6.7

Add .is support

I'm not very used to pull requests so here are the changes needed to enable lookups for .is domains:

diff --git a/whois/_3_adjust.py b/whois/_3_adjust.py
index f38f785..3f7d555 100644
--- a/whois/_3_adjust.py
+++ b/whois/_3_adjust.py
@@ -69,6 +69,7 @@ DATE_FORMATS = [
        '%Y-%m-%dT%H:%M:%S%z',                  # 2011-03-30T19:36:27+0200
        '%Y-%m-%dT%H:%M:%S.%f%z',               # 2011-09-08T14:44:51.622265+03:00
        '%Y-%m-%dt%H:%M:%S.%f',                 # 2011-09-08t14:44:51.622265
+       '%B %d %Y',                             # January 01 2000
 ]


diff --git a/whois/__init__.py b/whois/__init__.py
index 96869fd..4794504 100644
--- a/whois/__init__.py
+++ b/whois/__init__.py
@@ -42,6 +42,7 @@ def query(domain, force=0, cache_file=None, slow_down=0, ignore_returncode=0):
        if len(d) == 1: return None

        if domain.endswith('.co.jp'): tld = 'co_jp'
+       elif domain.endswith('.is'): tld = 'is_is'
        else: tld = d[-1]

        if tld not in TLD_RE.keys(): raise Exception('Unknown TLD: %s\n(all known TLD: %s)' % (tld, list(TLD_RE.keys())))
diff --git a/whois/tld_regexpr.py b/whois/tld_regexpr.py
index c97532e..56f3efe 100644
--- a/whois/tld_regexpr.py
+++ b/whois/tld_regexpr.py
@@ -233,4 +233,16 @@ fr = {

 'name_servers':                                r'nserver:\s*(.+)',
 'status':                                      r'status:\s?(.+)',
-}
\ No newline at end of file
+}
+
+is_is = {
+'domain_name':                         r'domain:\s?(.+)',
+'registrar':                           None,
+'registrant':                          r'registrant:\s?(.+)',
+'creation_date':                       r'created:\s?(.+)',
+'expiration_date':                     r'expires:\s?(.+)',
+'updated_date':                                None,
+'name_servers':                                r'nserver:\s?(.+)',
+'status':                              None,
+'emails':                              r'[\w.-]+@[\w.-]+\.[\w]{2,4}',
+}

No expiration date for some TLDs

Describe the bug
The "expiration_date" is always "None" for ".com", ".net" and ".eu" domains if running with Python 2.7.5. The correct expiration date is returned for ".it", ".info", ".biz", ".io" and ".sh".

To Reproduce
Just run the sample code from the PyPI wih whois 0.9.5 and Python 2.7.5:

import whois
domain = whois.query('google.com')
print(domain.__dict__)

Tried on CentOS 7.x running with python-2.7.5-80 and jwhois-4.0-45.

.org whois format changed

What steps will reproduce the problem?
>>> import whois
>>> w = whois.query("google.org")
>>> print (w.__dict__)
{'last_updated': None, 'name': 'google.org', 'expiration_date': None, 
'creation_date': None, 'registrar': 'MarkMonitor Inc.', 'name_servers': 
{'ns3.google.com', 'ns4.google.com', 'ns1.google.com', 'ns2.google.com'}}

What is the expected output? What do you see instead?
last_updated, expiration_date and creation_date should be populated instead of 
being set to None.

What version of the product are you using? On what operating system?
Gentoo Linux
$ python --version
Python 3.2.5
$ pip show whois

---
Name: whois
Version: 0.7
Location: /usr/lib/python3.2/site-packages
Requires:
$ whois --version
Version 5.0.25.

Please provide any additional information below.
It looks like the whois format for .org domains has changed:
$ whois google.org
Domain Name: GOOGLE.ORG
Domain ID: D2244233-LROR
Creation Date: 1998-10-21T04:00:00Z
Updated Date: 2013-09-18T09:17:35Z
Registry Expiry Date: 2014-10-20T04:00:00Z
...

I attached a patch for tld_regexpr.py which fixes the problem for me.

Thanks!

Original issue reported on code.google.com by [email protected] on 22 Jan 2014 at 6:51

Attachments:

Can't get nameservers on newest revision

Describe the bug
The newest revision can't get the name_servers. I have my old build and still running well in remote vm

To Reproduce
Steps to reproduce the behavior:

  1. create new virtualenv
  2. $ pip install git+https://github.com/DannyCork/python-whois
  3. get the domain data
$ python
Python 3.7.3 (default, Apr  3 2019, 05:39:12)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import whois
>>> domain = whois.query('google.com')
>>> print(domain.__dict__)
{'name': 'google.com', 'registrar': 'MarkMonitor Inc.', 'creation_date': datetime.datetime(1997, 9, 15, 4, 0), 'expiration_date': datetime.datetime(2020, 9, 14, 4, 0), 'last_updated': None, 'name_servers': set()}
>>>

Expected behavior
the name_servers shouldn't be None

Additional context

$ pip freeze --local
pkg-resources==0.0.0
whois==0.9.3


$ python --version
Python 3.7.3

how to find the age of domain

on substracting expiration date and creation date, it gives Type Error
TypeError: can't subtract offset-naive and offset-aware datetimes

extend support for .pl domains

Extend support
Extend regex for .pl to support domain other than active states.

whois for active domains returns the expiration date under "renewal date" line however there are other states for domains and now the expiration date for them is returned None, but it is actually returned from whois but under "expiration date" line.

best,
mike

Not available from Django

Hello.

I want to use whois.query from Django.
But it didn't work.

From my python console on my windows10 and ubuntu18.4
The following code worked.

$ python

import whois
domain = whois.query('google.com')
print(domain.dict)

But when you call whois.query from Django,
The domain variable is None.

Looking at the source code, you can see that None is returned in the following places.

return Domain(pd) if pd['domain_name'][0] else None

Please let me know how you can use it in Django.

Thanks.

Retrieve Domain Status Information From WhoIs Results

What steps will fix the problem?
1. As it is, no domain status is provided in the dictionary
2. Sample script:

import whois

domain = whois.query('google.com')
print (domain.status)

3. Simple change/addition to '_3_adjust.py' on line 17 (tabbed as necessary):
self.status = data['status']

What is the expected output? What do you see instead?

This returns the entries on a single line.
['clientDeleteProhibited', 'clientRenewProhibited', 'clientTransferProhibited', 
'clientUpdateProhibited']

With this change, thought output is provided, it should be listed as such:
clientDeleteProhibited
clientRenewProhibited
clientTransferProhibited
clientUpdateProhibited

What version of the product are you using? On what operating system?
Kubuntu 12.10
Python 3.2
whois 0.7

Please provide any additional information below.
Looking to get all of the domain status information as a list; 1 item per line.

The search is also getting "Domain status" in the results.
Found this out when a domain with "OK" is coming back twice.

Domain status: ok
Status: ok

The regex should be made a literal "Status".

Original issue reported on code.google.com by [email protected] on 20 Jan 2013 at 6:58

.it domains coming back with data for .it TLD

Running latest as per pypi, on python 3.7.3. Output below:

(venv) Aarons-MacBook-Pro:whois aaron$ pip list
Package    Version
---------- -------
pip        19.1.1 
py-spy     0.1.11 
setuptools 41.0.1 
whois      0.8    
WARNING: You are using pip version 19.1.1, however version 19.2.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(venv) Aarons-MacBook-Pro:whois aaron$ python
Python 3.7.3 (default, Mar 27 2019, 09:23:15) 
[Clang 10.0.1 (clang-1001.0.46.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import whois
>>> domain = whois.query('google.com')
>>> domain.name
'google.com'
>>> domain.__dict__
{'name': 'google.com', 'registrar': 'MarkMonitor Inc.', 'creation_date': datetime.datetime(1997, 9, 15, 4, 0), 'expiration_date': datetime.datetime(2020, 9, 13, 21, 0, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=61200))), 'last_updated': None, 'name_servers': {'ns2.google.com\r', 'ns3.google.com\r', 'ns2.google.com', 'ns3.google.com', 'ns4.google.com', 'ns4.google.com\r', 'ns1.google.com\r', 'ns1.google.com'}}
>>> 
>>> domain = whois.query('google.it')
>>> domain.name
'it'
>>> domain.__dict__
{'name': 'it', 'registrar': '', 'creation_date': datetime.datetime(1987, 12, 23, 0, 0), 'expiration_date': datetime.datetime(2020, 4, 21, 0, 0), 'last_updated': datetime.datetime(2019, 5, 7, 1, 4, 50), 'name_servers': set()}
>>> quit()

Exception: Unknown TLD: ca

$ cat a.py
import whois

domain = 'invisiblebracesintoronto.ca'
whois.query(domain, 'A')

$ python a.py
Exception: Unknown TLD: ca
(all known TLD: ['co', 'it', 'cz', 'at', 'eu', 'ru', 'lv', 'nz', 'net', 'pl', 
'be', 'fr', 'de', 'jp', 'me', 'co_jp', 'biz', 'org', 'info', 'name', 'us', 
'uk', 'com'])

Original issue reported on code.google.com by [email protected] on 5 Oct 2014 at 4:21

TLD .de not working

query from any domain from .de is not working

Python 3.7.4 (default, Sep 7 2019, 18:27:02)
[Clang 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import whois
data = whois.query("google.com")
print(data.dict)
{'name': 'google.com', 'registrar': 'MarkMonitor Inc.', 'creation_date': datetime.datetime(1997, 9, 15, 4, 0), 'expiration_date': datetime.datetime(2028, 9, 14, 4, 0), 'last_updated': None, 'name_servers': set()}
data = whois.query("spiegel.de")
print(data.dict)
{'name': 'de', 'registrar': '', 'creation_date': None, 'expiration_date': None, 'last_updated': datetime.datetime(2019, 10, 29, 0, 0), 'name_servers': {'l.de.net', 's.de.net', 'a.nic.de', 'n.de.net', 'z.nic.de', 'f.nic.de'}}

โ–ถ whois spiegel.de
% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object

refer: whois.denic.de

domain: DE

organisation: DENIC eG
address: Kaiserstrasse 75-77
address: Frankfurt am Main 60329
address: Germany

contact: administrative
name: Vorstand DENIC eG
organisation: DENIC eG
address: Kaiserstrasse 75-77
address: Frankfurt am Main 60329
address: Germany
phone: +49 69 27235 0
fax-no: +49 69 27235 235
e-mail: [email protected]

contact: technical
name: Business Services
organisation: DENIC eG
address: Kaiserstrasse 75-77
address: Frankfurt am Main 60329
address: Germany
phone: +49 69 27235 272
fax-no: +49 69 27235 234
e-mail: [email protected]

nserver: A.NIC.DE 194.0.0.53 2001:678:2:0:0:0:0:53
nserver: F.NIC.DE 2a02:568:0:2:0:0:0:53 81.91.164.5
nserver: L.DE.NET 2001:668:1f:11:0:0:0:105 77.67.63.105
nserver: N.DE.NET 194.146.107.6 2001:67c:1011:1:0:0:0:53
nserver: S.DE.NET 195.243.137.26 2003:8:14:0:0:0:0:53
nserver: Z.NIC.DE 194.246.96.1
ds-rdata: 39227 8 2 aab73083b9ef70e4a5e94769a418ac12e887fc3c0875ef206c3451dc40b6c4fa
ds-rdata: 45580 8 2 918c32e2f12211766be6226674f447458f2259b9a0d87b44d29d55afeca6b2e1

whois: whois.denic.de

status: ACTIVE
remarks: Registration information: http://www.denic.de/

created: 1986-11-05
changed: 2019-10-29
source: IANA

% Restricted rights.
%
% Terms and Conditions of Use
%
% The above data may only be used within the scope of technical or
% administrative necessities of Internet operation or to remedy legal
% problems.
% The use for other purposes, in particular for advertising, is not permitted.
%
% The DENIC whois service on port 43 doesn't disclose any information concerning
% the domain holder, general request and abuse contact.
% This information can be obtained through use of our web-based whois service
% available at the DENIC website:
% http://www.denic.de/en/domains/whois-service/web-whois.html
%
%

Domain: spiegel.de
Nserver: ns1.p20.dynect.net
Nserver: ns2.p20.dynect.net
Nserver: ns3.p20.dynect.net
Nserver: ns4.p20.dynect.net
Status: connect
Changed: 2019-08-21T16:57:18+02:00

Error on: addersp.it

Hey,

Other error on it tld: I got this log:

  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/whois/__init__.py", line 50, in query
    pd = do_parse(do_query(d, force, cache_file, slow_down, ignore_returncode), tld)
  File "/Library/Python/2.7/site-packages/whois/_2_parse.py", line 36, in do_parse
    raise Exception(whois_str)
Exception: Domain:             addersp.it
Status:             AVAILABLE

Retrieve Email Address From WhoIs Results

What steps will reproduce the problem?
1. Currently, the email address is not available in the dictionary.
2. Simple script:

import whois

domain = whois.query('google.com')
print (domain.emails)

3. Simple change/addition to '_3_adjust.py' after line 16 (tabbed as necessary):
self.status = data['emails'][0].strip()


What is the expected output? What do you see instead?
With the above entry, it will print the first email address.
The first email address is usually the Administrative Contact for the domain.
This can be helpful for proving ownership of the domain, per contact.


What version of the product are you using? On what operating system?
Kubuntu 12.10
Python 3.2
whois 0.7


Please provide any additional information below.
Tested it and it works with the change.
It just needs to be added and updated for the upgrade :)

Original issue reported on code.google.com by [email protected] on 20 Jan 2013 at 7:04

missing date format for .de

What steps will reproduce the problem?
1. check expiration date of domain (fraukesart.de)

What do you see instead?

ValueError: Unknown date format: '2013-01-25t06:14:54+0100'

What version of the product are you using? On what operating system?
0.7 from pypi @debian wheezy






Original issue reported on code.google.com by [email protected] on 19 Apr 2013 at 1:01

Python 3 run error

When I run

import whois
domain = whois.query('google.com')
#print(domain.expiration_date)
print(domain.name)

i didn't get google.com but get the all context of whois .
Can you give me some example for Python3?

Error on: abroco.me

I'm using your lib with dict and it fails with this log for abroco.me:

File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/whois/__init__.py", line 54, in query
    return Domain(pd) if pd['domain_name'][0] else None
TypeError: 'NoneType' object has no attribute '__getitem__'

Support for .nz

It would be great if this library could support .nz (New Zealand) domain names.

Can I help in any way?

Here are a few example domains:

- cloud.geek.nz
- safe-rm.org.nz
- catalyst.net.nz
- trademe.co.nz

Original issue reported on code.google.com by [email protected] on 24 Jun 2012 at 6:18

Issue with versions less than 3.0

For versions less than 3 it is failing.

However after changing the following line 

   Old : import simplejson as json
   New : import json as simplejson

It is working fine.

In the file _1_query.py.

Thanks, Nag

Original issue reported on code.google.com by [email protected] on 17 Jul 2012 at 11:09

.biz is not working

Describe the bug

whois abc.biz result:

Domain Name: abc.biz
Registry Domain ID: D2826296-BIZ
Registrar WHOIS Server:
Registrar URL: www.markmonitor.com
Updated Date: 2019-02-27T10:56:13Z
Creation Date: 2002-03-27T12:27:51Z
Registry Expiry Date: 2020-03-26T23:59:59Z

Registrar: MarkMonitor, Inc.
Registrar IANA ID: 292
Registrar Abuse Contact Email: [email protected]
Registrar Abuse Contact Phone: +1.2083895740
Domain Status: clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited
Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
Domain Status: clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited
.
.
.

print(whois.query('abc.biz').__dict__) result:

{'name': 'abc.biz', 'registrar': '', 'creation_date': None, 'expiration_date': None, 'last_updated': None, 'name_servers': set()}

cause : tld_regexpr.py mismapping (creation_date, expiration_date, update_date)

object has no attribute 'query'

I already know that this problem has already been solved, but the solution for me was not that.
-my .py file name isn't whois.py
-whois version 0.8
-installed with pip3 install whois

Code:
target = ('google.com')
n = whois.query(target)
print(n)

Error: file not found

import whois
info = whois.query("google.com")
print(info)

Results in the following traceback:

Traceback (most recent call last):
  File "/home/mastermind/Projects/DomainInformation/getinfo.py", line 13, in <module>
    info = whois.query(domain)
  File "/usr/local/lib/python3.5/dist-packages/whois/__init__.py", line 50, in query
    pd = do_parse(do_query(d, force, cache_file, slow_down, ignore_returncode), tld)
  File "/usr/local/lib/python3.5/dist-packages/whois/_1_query.py", line 44, in do_query
    _do_whois_query(dl, ignore_returncode),
  File "/usr/local/lib/python3.5/dist-packages/whois/_1_query.py", line 58, in _do_whois_query
    p = subprocess.Popen(['whois', '.'.join(dl)], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
  File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'whois'

(whois package installed through pycharm/pip)

URL result: [Error 2] The system cannot find the file specified

I have installed whois in my windows 10 machine.

When I do the whois('google.com'), I am encountering the error below.

URL result
[Error 2] The system cannot find the file specified

This also happens for all url I have used.

Please I need help. Thanks!

NET is missing from tld_regexpr.py

What steps will reproduce the problem?
1. attempt to run a whois against any domain with .net
2.
3.

What is the expected output? What do you see instead?
Expected .net domain to work... however it states unsupported.  

What version of the product are you using? On what operating system?
version 0.6.4 from pypi

Please provide any additional information below.
I am guesing that this is an oversight, as you mention that NET is supported in 
the description.  I have added the below entry in my local tld_regexpr.py to 
add .net support

net = {
'extend': 'com',
}


Original issue reported on code.google.com by [email protected] on 3 Jul 2012 at 7:43

Python3.2.3, virtualenv, MacOS 10.8 not working

>>> import whois
>>> domain = whois.query('google.com')
>>> domain.expiration_date
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'expiration_date'
What is the expected output? What do you see instead?

I used latest stable (installed via pip) version

Original issue reported on code.google.com by [email protected] on 4 Aug 2012 at 12:23

.pl domain always return "request limit exceeded"

Describe the bug
we always have "request limit exceeded". when doing whois for .pl domains. The problem is not the code. but the domain itself.

I need to open this issue, to discuss, on how to handle this problem. Should we wait for the domain to be corrected. Or should we handle "request limit exceeded", in our codebase ?

To Reproduce
Steps to reproduce the behavior:

  1. run the test
  2. or run $ whois google.pl (yes, the error is not from our codebase)

no way to execute whois

import whois

domain = whois.query('google.com')
print (domain.status)


output:
Traceback (most recent call last):
  File "/root/workspace/test1/src/pkg/w.py", line 1, in <module>
    import whois
  File "/root/workspace/test1/src/pkg/whois.py", line 2, in <module>
AttributeError: 'module' object has no attribute 'query'

OS CentOS 6.4
Python 2.6.6

Original issue reported on code.google.com by [email protected] on 27 Oct 2013 at 7:20

Local variable 'tz' is referenced before assignment

I installed the library via pip, I also installed Linux Whois via apt-get.

I have the following code:

import whois
domain = whois.query('google.com')

However, the following error pops up: Local variable 'tz' is referenced before assignment.
This comes up from the _3_adjust.py file:

def str_to_date_py2(s):
    tmp = re.findall('\+([0-9]{2})00', s)
    if tmp:
        tz = int(tmp[0])
    else:
        z = 0

    for format in DATE_FORMATS:
        try:
            return datetime.datetime.strptime(s, format) + datetime.timedelta(hours=tz)
        except ValueError:
            pass

raise UnknownDateFormat("Unknown date format: '%s'" % s)

It seems that 'tz' is only assigned if 'tmp' exists. In other cases 'z' is assigned 0. I assume this needs to be tz instead of z?

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.