Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.183 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.63; '*S*': 0.00; 'exception': 0.12; 'tries': 0.15; '"import': 0.16; 'except:': 0.16; 'share?': 0.16; 'this:': 0.16; 'later': 0.19; 'wrote': 0.21; 'header:In-Reply-To:1': 0.22; 'clause': 0.23; 'guess': 0.26; 'code': 0.26; 'tried': 0.27; "i'm": 0.28; 'subject:skip:u 10': 0.29; 'button,': 0.30; 'threads': 0.30; 'throwing': 0.30; 'chris': 0.30; 'file.': 0.31; 'thread': 0.32; 'does': 0.32; "can't": 0.33; 'header:User-Agent:1': 0.33; 'wondering': 0.34; 'running': 0.34; 'stuck': 0.34; 'try:': 0.34; 'to:addr:python-list': 0.35; 'however,': 0.35; 'something': 0.35; 'but': 0.37; 'shows': 0.37; 'another': 0.37; 'received:192': 0.38; 'references': 0.38; 'should': 0.38; 'right,': 0.39; 'except': 0.39; 'to:addr:python.org': 0.40; 'your': 0.61; 'manager,': 0.62; 'else.': 0.67; 'press': 0.69; 'received:62': 0.70; 'click': 0.78; '100%': 0.82; '17:34': 0.84; 'received:192.168.13': 0.84; 'received:62.179': 0.84; 'received:62.179.121': 0.84; 'received:upcmail.net': 0.84 X-SourceIP: 80.99.162.160 Date: Sat, 17 Mar 2012 18:31:33 +0100 From: Laszlo Nagy User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: python-list@python.org Subject: Re: urllib.urlretrieve never returns??? References: <4F649BFC.1080601@shopzeus.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1332005526 news.xs4all.nl 6928 [2001:888:2000:d::a6]:37896 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:21824 2012.03.17. 17:34 keltezéssel, Chris Angelico wrote > 2012/3/18 Laszlo Nagy: >> In the later case, "log.txt" only contains "#1" and nothing else. If I look >> at pythonw.exe from task manager, then its shows +1 thread every time I >> click the button, and "#1" is appended to the file. > try: > fpath = urllib.urlretrieve(imgurl)[0] > except: > self.Log(traceback.format_exc()) > return > > > Just a stab in the dark, but I'm wondering if something's throwing an > exception when it's running without a GUI? Your except clause > references 'traceback' which I don't see anywhere else - or is that > part of the code you can't share? Anyway, my guess is that something > perhaps tries to write to the console and can't, and it gets stuck > inside format_exc(). Is that testable? You are right, I should have added "import traceback". However, I tried this: try: fpath = urllib.urlretrieve(imgurl)[0] except: self.Log("Exception") return and still nothing was logged. Another proof is that the number of threads is increased every time I press the button. So I'm 100% sure that urlretrieve does not return from the call.