Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #21827
| From | Christian Heimes <lists@cheimes.de> |
|---|---|
| Subject | Re: urllib.urlretrieve never returns??? |
| Date | 2012-03-17 19:18 +0100 |
| References | <4F649BFC.1080601@shopzeus.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.763.1332008322.3037.python-list@python.org> (permalink) |
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. Christian
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: urllib.urlretrieve never returns??? Christian Heimes <lists@cheimes.de> - 2012-03-17 19:18 +0100
csiph-web