473,671 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1710
On Thu, 11 Mar 2004 11:26:12 +0100, Otto Krüse <ot********@hot mail.com>
declaimed the following in comp.lang.pytho n:

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.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
=============== =============== =============== =============== == <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.ne tcom.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********@hot mail.com>
declaimed the following in comp.lang.pytho n:

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.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
> wu******@dm.net | Bestiaria Support Staff <
> =============== =============== =============== =============== == <
> Home Page: <http://www.dm.net/~wulfraed/> <
> Overflow Page: <http://wlfraed.home.ne tcom.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********@hot mail.com>
declaimed the following in comp.lang.pytho n:
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='localhos t', 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.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
=============== =============== =============== =============== == <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.ne tcom.com/> <

Jul 18 '05 #5

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

Similar topics

2
5012
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. All is fine and dandy right now, but come next week... that things wont be so dandy. I am setting our LInux router/server back up soon, and would like a quick, easy way to enable and disable our internet access. What I would like to do is have...
5
7065
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 _tkinter.pyd seems to expect them in the same directory (Question 1) Is there a configration or path setting in py2exe/distutils I
3
3451
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 my own use, I want to write a program that will download certain data for me from the Internet. I have spent a lot of time trying to find books to tell me how to achieve this, but with my lack of experience (and need) of using the various...
3
3753
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 "YES!" but I need to know how... There should be some articles on that...
2
3030
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 a user that runs the software behind a firewall. He's getting proxy errors thrown, quite understandably since I simply assume an internet connection is available. So, how can I :
3
2239
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
3788
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 monitoring software but I don't want to act as 'big brother'. What would be the simplest, most reliable way to do this using c#?
9
3562
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 the day, but only in the evening (say, 5-12pm) will they actually be able to surf the net / play games etc. The users are not power users or admin, so they would not be able to install new programs (such as FireFox) to use the web, so I thought...
4
3727
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 (not the best for the task, but it's all I know). Some things I've considered: Modifying the registry in ...Software\Microsoft\Windows\CurrentVersion\Internet Settings -- Unfortunately, this doesn't block Firefox. (Does Firefox have a registry...
0
8401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8926
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7444
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6236
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5703
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4416
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2060
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.