gera2ld / async_dns

DNS library based on asyncio
MIT License
70 stars 17 forks source link

Backward incompatible changes introduced between 1.0.0 and 1.0.1 #9

Closed bclodius closed 5 years ago

bclodius commented 5 years ago

@gera2ld first of all shame on me for not doing pip freeze for my project dependencies; but wanted to report this for your awareness and in case anyone else is using this project.

Changes introduced here: https://github.com/gera2ld/async_dns/blob/e55cb7769157d1b84e4857f9ec0336c00e8646ee/async_dns/resolver/__init__.py#L207 to return multiple values can cause conflicts where code expects this function to only return a single value.

My sample code

...
answer = await resolver.query(hostname, types.A)
ip_addresses = [result.data for result in answer.an if result.qtype == 1]
...

Exception I was facing

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'tuple' object has no attribute 'an'

To remediate this I updated my requirements.txt to have async_dns==1.0.0

gera2ld commented 5 years ago

Sorry for the trouble, I didn't expect that there were dependents already. I'll change the API to what it looked before to keep it consistent.

gera2ld commented 5 years ago

fixed in 1.0.4

bclodius commented 5 years ago

thanks @gera2ld !