[Twisted-Python] Twisted Names strings

Laurens Van Houtven _ at lvh.cc
Thu Jan 17 12:24:21 EST 2013


FYI, this change also broke wokkel, too, so at least you're not alone, it
seems...

https://twistedmatrix.com/trac/ticket/6245


On Thu, Jan 17, 2013 at 5:22 PM, Angelo Dell'Aera <angelo.dellaera at gmail.com
> wrote:

>
> After updating Twisted to 12.3.0 I started getting errors like the
> following one
>
> 2013-01-17 14:38:23+0100 [-]   File
> "/usr/lib64/python2.7/site-packages/twisted/names/common.py", line 93, in
> lookupAddress
> 2013-01-17 14:38:23+0100 [-]     return self._lookup(name, dns.IN, dns.A,
> timeout)
> 2013-01-17 14:38:23+0100 [-]   File
> "/usr/lib64/python2.7/site-packages/twisted/names/client.py", line 384, in
> _lookup
> 2013-01-17 14:38:23+0100 [-]     d = self.queryUDP([dns.Query(name, type,
> cls)], timeout)
> 2013-01-17 14:38:23+0100 [-]   File
> "/usr/lib64/python2.7/site-packages/twisted/names/dns.py", line 484, in
> __init__
> 2013-01-17 14:38:23+0100 [-]     self.name = Name(name)
> 2013-01-17 14:38:23+0100 [-]
> File"/usr/lib64/python2.7/site-packages/twisted/names/dns.py", line 357, in
> __init__
> 2013-01-17 14:38:23+0100 [-]     raise TypeError("%r is not a byte string"
> % (name,))
> 2013-01-17 14:38:23+0100 [-] TypeError: u'example.com' is not a byte
> string
>
> Taking a look at documentation I found this document
>
> http://twistedmatrix.com/documents/current/core/howto/python3.html
>
> which states
>
> "twisted.names.dns deals with strings with a wide range of meanings,
> often several for each DNS record type. Most of these strings have
> remained as byte strings, which will probably require application
> updates (for the reason given in the FilePath section above). Some
> strings have changed to text strings, though. Any string representing a
> human readable address (for example, Record_A's address parameter) is
> now a text string. Additionally, time-to-live (ttl) values given as
> strings must now be given as text strings."
>
> which seems to describe the problem I'm experiencing.
>
> But let me say that I'm currently using Python 2.7.3 and I was surprised
> in realizing
> that a simple update from a minor 12.x release was enough to disrupt my
> application.
>
> Don't you think that a kind of compatibility mechanism (maybe with a
> warning message)
> would have been a more gentle way of doing this transition especially for
> those who
> are still using Python 2?
>
> Thanks and regards,
>
> --
>
> Angelo Dell'Aera 'buffer'
> Antifork Research, Inc.         http://buffer.antifork.org
> Sysenter Honeynet Project       http://www.sysenter-honeynet.org
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>



-- 
cheers
lvh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20130117/be9f9e57/attachment.htm 


More information about the Twisted-Python mailing list