{"push_id":590453775,"size":1,"distinct_size":1,"ref":"refs/heads/branches/python3-fixes","head":"d75221eefa619b3bc0934ce9e5f5a7de63f24cdf","before":"622271bfb1e4a4bea0154000d1c439591b33d0df","commits":[{"sha":"d75221eefa619b3bc0934ce9e5f5a7de63f24cdf","author":{"email":"4d3300f8eded75239a40c4d1d8fed5910ddc2497@fsi.io","name":"Robert Edmonds"},"message":"Encode to and from US-ASCII to avoid overusing the 'bytes' type\n\nThe DNS presentation format uses the US-ASCII character set de facto, so\nit ought to be safe to require presentation format strings to be strings\nthat happen to only use characters that are present in US-ASCII. For\ninstance, it should be possible to write:\n\n    wdns.str_to_rrtype('A')\n\nRather than:\n\n    wdns.str_to_rrtype(b'A')\n\nThis commit alters the Python wrappers for domain_to_str(),\nopcode_to_str(), rcode_to_str(), rrclass_to_str(), rrtype_to_str(), and\nrdata_to_str() to call .decode('ascii') on the byte array that we get\nback from libwdns. This should never fail because libwdns should always\nhand us back a US-ASCII string.\n\nThis commit also alters the Python wrappers for str_to_rrtype() and\nstr_to_name() to accept Python strings that use the US-ASCII subset of\ncharacters by calling .encode('ascii') on the string that we get from\nthe Python caller. This can fail if the caller passes a string that\ncan't be encoded into US-ASCII, but this should properly fail -- if the\ncaller needs to pass non-ASCII data in the presentation form of a DNS\nname, it should be escaped with ASCII-compatible DNS-style \\DDD escape\nliterals.","distinct":true,"url":"https://api.github.com/repos/farsightsec/pywdns/commits/d75221eefa619b3bc0934ce9e5f5a7de63f24cdf"}]}