473,394 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

py2exe distribution wants internet access (DNS)

Hello,

I've made a small GUI program that connects with a MySQL database to
collect information which is put on the screen. The database and the
program are used for testing purposes so I installed them locally and
only use them locally (so on my own computer).

When I run the script from a system (WinXP) shell through the python
interpreter all goes well. However when I make an executable program of
it through py2exe there's a problem. When I start the .exe file the
program wants to 'talk' to my DNS on the internet. My firewall sees this
and asks me if this all right.

Now if say 'yes' to the firewall the program runs as expected. But if I
say 'no' my program won't connect to the MySQL server. Now this isn't
quite right, I run MySQL locally so DNS access should not be necessary.
This firewall stuff also makes distributing the program harder: not all
users have access to firewall choices, on some machines programs are
blocked by default.

Why does the original python script run normally but does the py2exe
'conversion' of it want DNS access? How can I change this?

Thanks in advance,
Otto Krüse
Jul 18 '05 #1
4 1692
On Thu, 11 Mar 2004 11:26:12 +0100, Otto Krüse <ot********@hotmail.com>
declaimed the following in comp.lang.python:

Why does the original python script run normally but does the py2exe
'conversion' of it want DNS access? How can I change this?
Hypothesis: At some point in time you granted the Python
interpreter ITSELF access through the firewall. The file created by
py2exe may contain the interpreter, but it is NOT the same interpreter
to the firewall.

As a test, check your firewall configuration and remove all
Python related entries. Then see what happens. I suspect you'll find it
asks for access when run via "python xxx"
-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Jul 18 '05 #2
I don't think this is the answer because the python interpreter only
wants to access IP adress 0.0.0.0 for accessing it's subroutines. That's
something different than DNS access.

I think it has something to do with the MySQLdb module not being
'converted' as it should by py2exe.

My hypothesis:
When my program wants to connect with the MySQL dBase it sends a message
to the DNS to ask where it can find the MySQL server. DNS doesn't know
it so the program then checks locally and finds the MySQL server and
connects with it. However, if I block access to the DNS it will not find
the local server any more, this is strange I think.... In fact I don't
want my prgram to talk with a DNS, I want it to check for local servers
only.

Anyone know something about this?

Many thanks
Otto
Dennis Lee Bieber wrote:
On Thu, 11 Mar 2004 11:26:12 +0100, Otto Krüse <ot********@hotmail.com>
declaimed the following in comp.lang.python:

Why does the original python script run normally but does the py2exe
'conversion' of it want DNS access? How can I change this?


Hypothesis: At some point in time you granted the Python
interpreter ITSELF access through the firewall. The file created by
py2exe may contain the interpreter, but it is NOT the same interpreter
to the firewall.

As a test, check your firewall configuration and remove all
Python related entries. Then see what happens. I suspect you'll find it
asks for access when run via "python xxx"
--
> ================================================== ============ <
> wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
> wu******@dm.net | Bestiaria Support Staff <
> ================================================== ============ <
> Home Page: <http://www.dm.net/~wulfraed/> <
> Overflow Page: <http://wlfraed.home.netcom.com/> <

Jul 18 '05 #3
On Fri, 12 Mar 2004 13:17:08 +0100, Otto Krüse wrote:
My hypothesis:
When my program wants to connect with the MySQL dBase it sends a message
to the DNS to ask where it can find the MySQL server. DNS doesn't know it
so the program then checks locally and finds the MySQL server and connects
with it. However, if I block access to the DNS it will not find the local
server any more, this is strange I think.... In fact I don't want my
prgram to talk with a DNS, I want it to check for local servers only.


How about the line of code where you connect to the mysql server (i.e.
what IP are you using).

Regards,
Adam
Jul 18 '05 #4
On Fri, 12 Mar 2004 13:17:08 +0100, Otto Krüse <ot********@hotmail.com>
declaimed the following in comp.lang.python:
I don't think this is the answer because the python interpreter only
wants to access IP adress 0.0.0.0 for accessing it's subroutines. That's
something different than DNS access.
Huh... For local server it should be asking for
localhost/loopback - 127.0.0.1 if I recall. I've not tried anything that
needed a distributable installation, but my connect looks like:

myDB = MySQLdb.connect(host='localhost', user='bestiaria',
passwd='web-asst', db='bestiaria')

(It's a pain when one maintains web pages using MySQL database tables,
but do NOT have access to a server that permits CGI scripts -- meaning
one has to run a batch script every so often to update a template page
for upload to the web server)

I think it has something to do with the MySQLdb module not being
'converted' as it should by py2exe.
What's to convert? It just passes your connection string out.

Now, if your server is on a named host, you'll either have to
have that host listed in the hosts file (and the search order defined to
be hosts file followed by lookup), or you'll have to use DNS to
translate. If you physically list an IP number, it may be that MySQLdb
tries a reverse name lookup and, again, is not finding the host in a
hosts file so goes to DNS.
My hypothesis:
When my program wants to connect with the MySQL dBase it sends a message
to the DNS to ask where it can find the MySQL server. DNS doesn't know
it so the program then checks locally and finds the MySQL server and
connects with it. However, if I block access to the DNS it will not find
This implies that your system resolver sequence is DNS followed
by hosts -- though I'm not sure how the order is specified in Windows...

-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Derek White | last post by:
Ok here's the deal. We are finally getting DSL again... but our PC is in the living room... and the youngest has figured out that if he hits the right keys... he can bring up Internet Explorer....
5
by: Michael Peuser | last post by:
Hi, I should like to make a distribution (using Tkinter), with standard DLLs removed. pythonXX.dll is no problem. tcl und tk, which make the mass of mega bytes, cannot be removed because...
3
by: Paul Dixon | last post by:
I would appreciate some help on what is probably a fairly simple thing to do. I am a hardware designer, so my use of C is relatively limited, in that I only use it to do what I need to do. Now for...
3
by: Nurchi BECHED | last post by:
Hello, my dearest respected brother, All! Hey, guys, this is Nurchi again. I had a quick question: Can C# (I guess I should say .NET Framework) block internet access. I am sure the answer is...
2
by: JezB | last post by:
I'm writing a windows forms application which accesses the internet at various points in two different ways: - calling a webservice (.wsdl), - using the WebRequest & WebResponse methods. I have...
3
by: Chakkaradeep | last post by:
Hi all, How to retrieve Users Names and also restrict internet access to a specific users using C# ? Thanks. Regards, C.C.Chakkaradeep
3
by: richard.sutcliffe | last post by:
I want to write a small service that will simply disable internet access from my kids PC between certain times (to make sure they do their homework, etc). I know I could buy any number of internet...
9
by: wizardRahl | last post by:
Hello all, I'm looking for a way to basically disable IE (or internet access in general) through group policy. I would still like our users to be able to log on to the domain at all times during...
4
by: Umenzi | last post by:
I'm looking for different methods of disabling all internet access that work on XP and Vista. It would need to be reversible. Preferably, these methods would be accessible through a python program...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.