Skip to content

Socket Error: [Errno -2] Name or service not known TypeError: must be str, not bytes #139

Description

@mrgloom

With python-whois==0.6.8

What does TypeError: must be str, not bytes mean?

w = whois.whois('https://ura.news/news/1052315861')
Socket Error: [Errno -2] Name or service not known
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/miniconda3/lib/python3.6/site-packages/whois/__init__.py", line 40, in whois
    text = nic_client.whois_lookup(None, domain.encode('idna'), 0)
  File "/home/user/miniconda3/lib/python3.6/site-packages/whois/whois.py", line 189, in whois_lookup
    result = self.whois(query_arg, nichost, flags)
  File "/home/user/miniconda3/lib/python3.6/site-packages/whois/whois.py", line 134, in whois
    nhost = self.findwhois_server(response, hostname, query)
  File "/home/user/miniconda3/lib/python3.6/site-packages/whois/whois.py", line 78, in findwhois_server
    match = re.compile('Domain Name: ' + query + '\s*.*?Whois Server: (.*?)\s', flags=re.IGNORECASE|re.DOTALL).search(buf)
TypeError: must be str, not bytes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions