Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #21827

Re: urllib.urlretrieve never returns???

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'socket': 0.04; 'python': 0.08; 'exception.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'exception': 0.12; 'stderr': 0.16; 'timeout': 0.16; "doesn't": 0.22; 'header:In-Reply-To:1': 0.22; 'seconds': 0.26; 'windows': 0.26; 'code.': 0.26; 'import': 0.27; 'code,': 0.28; 'subject:skip:u 10': 0.29; 'example': 0.29; 'print': 0.29; 'resources.': 0.30; '(e.g.': 0.31; 'does': 0.32; 'header:User-Agent:1': 0.33; 'header:X-Complaints-To:1': 0.34; 'statement,': 0.34; 'work!': 0.34; 'to:addr:python-list': 0.35; 'received:org': 0.36; 'open': 0.38; 'e.g.': 0.39; 'received:de': 0.39; 'received:78': 0.40; 'to:addr:python.org': 0.40; 'here': 0.64; 'cause': 0.67; 'strange': 0.68; 'rights': 0.68
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Christian Heimes <lists@cheimes.de>
Subject Re: urllib.urlretrieve never returns???
Date Sat, 17 Mar 2012 19:18:25 +0100
References <4F649BFC.1080601@shopzeus.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host f049203040.adsl.alicedsl.de
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120310 Thunderbird/11.0
In-Reply-To <4F649BFC.1080601@shopzeus.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.763.1332008322.3037.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1332008322 news.xs4all.nl 6960 [2001:888:2000:d::a6]:49966
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:21827

Show key headers only | View raw


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


Thread

Re: urllib.urlretrieve never returns??? Christian Heimes <lists@cheimes.de> - 2012-03-17 19:18 +0100

csiph-web