Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI errors #16

Closed
jayvdb opened this issue Aug 27, 2020 · 1 comment
Closed

CLI errors #16

jayvdb opened this issue Aug 27, 2020 · 1 comment
Labels

Comments

@jayvdb
Copy link

jayvdb commented Aug 27, 2020

This is my first attempt at using the CLI, based on the README.

> python3 -m async_dns.resolver -n 8.8.8.8 www.google.com
usage: python3 -m async_dns.resolver [-h] [-n NAMESERVERS [NAMESERVERS ...]] [-t TYPES [TYPES ...]] hostnames [hostnames ...]
python3 -m async_dns.resolver: error: the following arguments are required: hostnames
> python3 -m async_dns.resolver www.google.com
Traceback (most recent call last):
  File "/usr/lib64/python3.8/runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib64/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.8/site-packages/async_dns/resolver/__main__.py", line 57, in <module>
    resolve_hostnames(_parse_args())
  File "/usr/lib/python3.8/site-packages/async_dns/resolver/__main__.py", line 48, in resolve_hostnames
    res = fut.result()
  File "/usr/lib/python3.8/site-packages/async_dns/resolver/__main__.py", line 24, in resolve_hostname
    return await resolver.query(hostname, qtype)
  File "/usr/lib/python3.8/site-packages/async_dns/resolver/__init__.py", line 38, in query
    result, _cached = await self.query_with_timeout(fqdn, qtype, timeout, tick)
  File "/usr/lib/python3.8/site-packages/async_dns/resolver/__init__.py", line 51, in query_with_timeout
    return await asyncio.wait_for(self._query(fqdn, qtype, tick), timeout)
  File "/usr/lib64/python3.8/asyncio/tasks.py", line 483, in wait_for
    return fut.result()
  File "/usr/lib/python3.8/site-packages/async_dns/resolver/__init__.py", line 59, in _query
    addr = Address.parse(fqdn)
  File "/usr/lib/python3.8/site-packages/async_dns/core/address.py", line 120, in parse
    assert addr.ip_type, InvalidHost(hostinfo.hostname)
AssertionError: www.google.com

fwiw, I am running a package which was built a different way, which could be part of the problem.
The build process is at https://build.opensuse.org/package/show/home:jayvdb:py-new/python-async-dns

@gera2ld gera2ld added the bug label Aug 28, 2020
@gera2ld
Copy link
Owner

gera2ld commented Aug 28, 2020

Something is wrong when qtype=ANY. You may try this as a workaround:

> python3 -m async_dns.resolver -n 8.8.8.8 -t A AAAA -- www.google.com

Note that -- is needed before hostnames because -t or -n in your case can have multiple arguments, I'll fix this in the document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants