[Twisted-Python] twisted.names.error.DNSNameError on MacOsX but not on linux
Hello everyone, I wrote a twisted app using the XMPP code that works fin on linux (and windows), but on Mac I get a twisted.names.error.DNSNameError, I searched google but found nothing on this, is there a known bug with Twisted on Mac? I have Mac OS X 10.5.8, and the latest version of twisted from the website. Thank you, Gabriel
On 03:50 pm, gabriel.rossetti@arimaz.com wrote:
Hello everyone,
I wrote a twisted app using the XMPP code that works fin on linux (and windows), but on Mac I get a twisted.names.error.DNSNameError, I searched google but found nothing on this, is there a known bug with Twisted on Mac?
I have Mac OS X 10.5.8, and the latest version of twisted from the website.
DNS is good at having behavior sensitive to the environment you are using it in. I'm not sure if there are any known bugs which would explain the problem you're encountering, mostly because I don't really know what problem you're encountering. ;) "twisted app using XMPP code" and "get a DNSNameError" don't say a whole lot. What API is failing? What other details can you provide? It may be a bug in Twisted, or it may be a configuration issue relating to your Mac host. Jean-Paul
exarkun@twistedmatrix.com wrote:
On 03:50 pm, gabriel.rossetti@arimaz.com wrote:
Hello everyone,
I wrote a twisted app using the XMPP code that works fin on linux (and windows), but on Mac I get a twisted.names.error.DNSNameError, I searched google but found nothing on this, is there a known bug with Twisted on Mac?
I have Mac OS X 10.5.8, and the latest version of twisted from the website.
DNS is good at having behavior sensitive to the environment you are using it in. I'm not sure if there are any known bugs which would explain the problem you're encountering, mostly because I don't really know what problem you're encountering. ;) "twisted app using XMPP code" and "get a DNSNameError" don't say a whole lot. What API is failing? What other details can you provide? It may be a bug in Twisted, or it may be a configuration issue relating to your Mac host.
Jean-Paul
Hello jean-Paul, I just saw your msg, I have sent some example code. I think I nkow where this is comming from, Apple has a version of twisted installed in it's python frameworks, and it's version 2.5. I just remembered I had the same error when on version 2.5 on linux. The problem is I don't know how to cleanly resolve this problem, I would need python to use my cersion an not Apple's, but how to do this? Gabriel
Gabriel Rossetti wrote:
Hello everyone,
I wrote a twisted app using the XMPP code that works fin on linux (and windows), but on Mac I get a twisted.names.error.DNSNameError, I searched google but found nothing on this, is there a known bug with Twisted on Mac?
I have Mac OS X 10.5.8, and the latest version of twisted from the website.
Thank you, Gabriel
Here is some example code (from Twisted), this works as-is on linux but
not on Mac. I tried an internal and an external XMPP server. On Mac I
get this :
python xmpp_client.py test@toto.com 123
2009/08/11 18:21 +0200 [-] Log opened.
2009/08/11 18:21 +0200 [-] Starting factory
On 04:30 pm, gabriel.rossetti@arimaz.com wrote:
Gabriel Rossetti wrote:
Hello everyone,
I wrote a twisted app using the XMPP code that works fin on linux (and windows), but on Mac I get a twisted.names.error.DNSNameError, I searched google but found nothing on this, is there a known bug with Twisted on Mac?
I have Mac OS X 10.5.8, and the latest version of twisted from the website.
Thank you, Gabriel
Here is some example code (from Twisted), this works as-is on linux but not on Mac. I tried an internal and an external XMPP server. On Mac I get this :
Perhaps this is the problem: http://twistedmatrix.com/trac/ticket/3456 Jean-Paul
On Tue, 2009-08-11 at 18:30 +0200, Gabriel Rossetti wrote:
[..]
Apparently you modified the original example here:
[..] connector = XMPPClientConnector(reactor, "10.204.232.117", f) connector.connect()
This would never work properly. XMPPClientConnector is designed to do an SRV record look up on the /domain/ provided as its second argument. You pass an IP address here and that will just fail. The original example passes client_jid.host. This extracts the domain from the JID you want to connect with and then follows the procedure of first trying to find xmpp-server SRV records for that domain, and if that fails, try to connect to the host that the domain name resolves to, using the default port (5222), as outlined in RFC 3920. Note that XMPPClientConnector avoids the problems sketched in ticket #3456 that was mentioned by Jean-Paul. If you really want to connect to a specific host instead of following the above procedure, you can do this instead of the code quoted above: reactor.connectTCP("10.204.232.117", 5222, f) -- Groetjes, ralphm -- Groetjes, ralphm
Ralph Meijer wrote:
On Tue, 2009-08-11 at 18:30 +0200, Gabriel Rossetti wrote:
[..]
Apparently you modified the original example here:
[..] connector = XMPPClientConnector(reactor, "10.204.232.117", f) connector.connect()
This would never work properly. XMPPClientConnector is designed to do an SRV record look up on the /domain/ provided as its second argument. You pass an IP address here and that will just fail.
The original example passes client_jid.host. This extracts the domain from the JID you want to connect with and then follows the procedure of first trying to find xmpp-server SRV records for that domain, and if that fails, try to connect to the host that the domain name resolves to, using the default port (5222), as outlined in RFC 3920. Note that XMPPClientConnector avoids the problems sketched in ticket #3456 that was mentioned by Jean-Paul.
If you really want to connect to a specific host instead of following the above procedure, you can do this instead of the code quoted above:
reactor.connectTCP("10.204.232.117", 5222, f)
Hmmm, ok, it works on linux and windows though, but I did as you said anyways as it's still flacky on mac. Thanks, Gabriel -- Arimaz SA Ingénieur en Informatique Av. du 24 Janvier 11 Ateliers de la Ville de Renens, Atelier 5 1020 Renens, Switzerland www.arimaz.com www.mydeskfriend.com Mob: +41-(0)79-539-0069 Tel: +41-(0)21-566-7343
participants (3)
-
exarkun@twistedmatrix.com
-
Gabriel Rossetti
-
Ralph Meijer