urllib.urlretrieve never returns???

Laszlo Nagy gandalf at shopzeus.com
Mon Mar 19 08:55:51 CET 2012


On 2012-03-17 19:18, Christian Heimes wrote:
> Am 17.03.2012 15:13, schrieb Laszlo Nagy:
>> See attached example code. I have a program that calls exactly the same
>> code, and here is the strange thing about it:
>>
>>    * Program is started as "start.py", e.g. with an open console. In this
>>      case, the program works!
>>    * Program is started as "start.pyw", e.g. with no open console under
>>      Windows 7 64bit - the program does not work!
> The pythonw.exe may not have the rights to access network resources.
> Have you set a default timeout for sockets?
>
> import socket
> socket.setdefaulttimeout(10) # 10 seconds
>
> A pyw Python doesn't have stdout, stderr or stdin. Any attempt to write
> to them (e.g. print statement, default exception logger) can cause an
> exception.
Yes, that is why I started the app with

wx.PySimpleApp(redirect=True)

so stdout is redirected into a window. Unfortunately, nothing is logged.

I'm going to turn off the firewall and start as admin today. That might 
be the solution. Thanks!



More information about the Python-list mailing list