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

Use of deprecated dnspython method #818

Open
blink1073 opened this issue Nov 1, 2023 · 2 comments · May be fixed by #840
Open

Use of deprecated dnspython method #818

blink1073 opened this issue Nov 1, 2023 · 2 comments · May be fixed by #840

Comments

@blink1073
Copy link

From the dnspython 2.0 release notes, "dns.resolver.resolve() has been added, allowing control of whether search lists are used. dns.resolver.query() is retained for backwards compatibility, but deprecated".

Example traceback (with warnings turned to errors):

.../site-packages/eventlet/support/greendns.py:549: in getaddrinfo
    qname, addrs = _getaddrinfo_lookup(host, family, flags)
.../site-packages/eventlet/support/greendns.py:511: in _getaddrinfo_lookup
    answer = resolve(host, qfamily, False, use_network=use_network)
.../site-packages/eventlet/support/greendns.py:456: in resolve
    return _proxy.query(name, rdtype, raise_on_no_answer=raises,
.../site-packages/eventlet/support/greendns.py:412: in query
    return end()
.../site-packages/eventlet/support/greendns.py:391: in end
    raise result[1]
.../site-packages/eventlet/support/greendns.py:372: in step
    a = fun(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    def query(
        self,
        qname: Union[dns.name.Name, str],
        rdtype: Union[dns.rdatatype.RdataType, str] = dns.rdatatype.A,
        rdclass: Union[dns.rdataclass.RdataClass, str] = dns.rdataclass.IN,
        tcp: bool = False,
        source: Optional[str] = None,
        raise_on_no_answer: bool = True,
        source_port: int = 0,
        lifetime: Optional[float] = None,
    ) -> Answer:  # pragma: no cover
        """Query nameservers to find the answer to the question.

        This method calls resolve() with ``search=True``, and is
        provided for backwards compatibility with prior versions of
        dnspython.  See the documentation for the resolve() method for
        further details.
        """
>       warnings.warn(
            "please use dns.resolver.Resolver.resolve() instead",
            DeprecationWarning,
            stacklevel=2,
        )
E       DeprecationWarning: please use dns.resolver.Resolver.resolve() instead
.../site-packages/dns/resolver.py:1359: DeprecationWarning
@4383
Copy link
Member

4383 commented Dec 15, 2023

Hello,

Thanks for reporting this issue. Do you want to create a pull request?

@4383
Copy link
Member

4383 commented Dec 15, 2023

I just proposed a patch to move to the usages to resolve. Feel free to comment #840

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

Successfully merging a pull request may close this issue.

2 participants