Nevermind...  5 minutes of Google searches turned up this post:

http://aspn.activestate.com/ASPN/Mail/Message/py2exe-users/3012190

Everything works as expected with my updated setup-dnstest.py:

from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
    options = {
        'py2exe': {
            'bundle_files': 1,
            'packages': ['dns']
         }},
    console = ["dnstest.py"],
    zipfile = None,
)

--
Michael Conigliaro
Computer Analyst
Fuss & O'Neill Technologies
www.fandotech.com
 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael
Conigliaro
Sent: Friday, September 19, 2008 10:40 AM
To: [email protected]
Subject: [Dnspython-users] Issues with py2exe?

I'm having a really strange issue where my queries are returning objects
of different types depending on whether my script is run via the Python
interpreter or compiled via py2exe.  I was just curious if this was a
known issue or if I'm making some obvious dumb mistake...

# dnstest.py
import dns.resolver
resolver = dns.resolver.Resolver()
answers = resolver.query('fandotech.com', 'MX')
for rdata in answers:
    print type(rdata)
    print rdata.to_text()

# setup-dnstest.py
from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
    options = {'py2exe': {'bundle_files': 1}},
    console = ["dnstest.py"],
    zipfile = None,
)


When running the script normally with the Python interpreter, rdata is
of type dns.rdtypes.ANY.MX.MX.  

I:\>dnstest.py
<class 'dns.rdtypes.ANY.MX.MX'>
10 ftdcex1.fandotech.com.


But when I compile it with py2exe and run the resulting executable,
rdata is of type dns.rdata.GenericRdata, and the to_text() method
doesn't return anything resembling a resource record.

I:\>dnstest.exe
<class 'dns.rdata.GenericRdata'>
\# 12 000a0766746463657831c00c

--
Michael Conigliaro
Computer Analyst
Fuss & O'Neill Technologies
www.fandotech.com
 

_______________________________________________
dnspython-users mailing list
[email protected]
http://howl.play-bow.org/mailman/listinfo.cgi/dnspython-users
_______________________________________________
dnspython-users mailing list
[email protected]
http://howl.play-bow.org/mailman/listinfo.cgi/dnspython-users

Reply via email to