pycares icon indicating copy to clipboard operation
pycares copied to clipboard

Update ares_query_txt_result_chunk to return bytes rather than str

Open maelp opened this issue 3 years ago • 6 comments

The RFC1035 specification says that TXT records are allowed to contain data made of arbitrary binary data, but right now aiodns is parsing it as a str, and therefore will stop on a null byte, this PR fixes this

maelp avatar Aug 10 '21 20:08 maelp

I think we need to apply the same to ares_query_txt_result, don't we? Also, I wonder why the GH action with the tests didn't run...

saghul avatar Aug 11 '21 07:08 saghul

I’m on holidays for a few days but I can do it when I come back

On 11 Aug 2021, at 09:52, Saúl Ibarra Corretgé @.***> wrote:

 I think we need to apply the same to ares_query_txt_result, don't we? Also, I wonder why the GH action with the tests didn't run...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

maelp avatar Aug 11 '21 17:08 maelp

Sure thing, no rush, and thanks for helping out with this!

saghul avatar Aug 11 '21 19:08 saghul

@saghul I guess that now that both return bytes it should work as expected

maelp avatar Aug 14 '21 15:08 maelp

It seems that the test_query_txt_multiple_chunked_with_non_ascii_content test fails because it is checking the server txt-non-ascii.dns-test.hmnid.ru which does not respond

https://mxtoolbox.com/SuperTool.aspx?action=txt%3atxt-non-ascii.dns-test.hmnid.ru&run=toolpage

maelp avatar Aug 17 '21 12:08 maelp

Also the test_idna_encoding_query_a test seems to fail because the A query to españa.icom.museum seems to respond with a NXDOMAIN and SOA response (non-existent domain)

; <<>> DiG 9.10.6 <<>> españa.icom.museum
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 15201
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;espa\195\177a.icom.museum.     IN      A

;; AUTHORITY SECTION:
icom.museum.            600     IN      SOA     ns.oxymium.net. hostmaster.oxymium.net. 2021072901 28800 3600 604800 7200

;; Query time: 432 msec
;; SERVER: 172.20.10.1#53(172.20.10.1)
;; WHEN: Tue Aug 17 14:33:51 CEST 2021
;; MSG SIZE  rcvd: 109

maelp avatar Aug 17 '21 12:08 maelp