sometimes,the output is:<br>error: [Errno 104] Connection reset by peer<div><includetail><div> </div><div style="font:Verdana normal 14px;color:#000;"><div style="FONT-SIZE: 12px;FONT-FAMILY: Arial Narrow;padding:2px 0 2px 0;">------------------ 原始邮件 ------------------</div><div style="FONT-SIZE: 12px;background:#efefef;padding:8px;"><div id="menu_sender"><b>发件人:</b> "Steven D'Aprano"<steve+comp.lang.python@pearwood.info>;</div><div><b>发送时间:</b> 2011年9月8日(星期四) 中午1:08</div><div><b>收件人:</b> "python-list"<python-list@python.org>; <wbr></div><div></div><div><b>主题:</b> Re: my  multi-download program can't finish</div></div><div> </div>On Thu, 8 Sep 2011 02:24 pm 守株待兔 wrote:<br><br>[...]<br>>              try:<br>>                  url = jobs.get()<br>>                  hx = httplib2.Http()<br>>                  resp, content = hx.request(url, headers=headers)<br>>                  jobs.task_done()<br>>              except:<br>>                  print  "wrong" , url<br><br>> when it run ,it can download someting ,<br>> it is strang:there is wrong output ,some web can't get,but  the program<br>> can't stop,it stay ,run ,can't fininsh, i don't know why?<br><br>If you read the helpful error messages that Python provides, instead of<br>hiding them and printing a useless message "wrong", you might find out why<br>the failures are happening.<br><br>Get rid of the try...except and see what exceptions you get. Then you will<br>be in a better situation to decide which exceptions should be caught, and<br>which are bugs that need to be fixed, and which should be allowed through.<br><br><br><br>-- <br>Steven<br><br>-- <br>http://mail.python.org/mailman/listinfo/python-list<br></div></includetail></div>