Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!news-transit.tcx.org.uk!newsfeed.xs4all.nl!newsfeed5.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'exception,': 0.07; 'raised': 0.07; 'urllib2': 0.07; 'python': 0.08; '>>>>': 0.09; 'dev': 0.09; 'exception': 0.12; 'meaningful': 0.13; '_call_chain': 0.16; 'func(*args)': 0.16; 'received:192.168.200': 0.16; 'subject:issues': 0.16; 'url_data': 0.16; 'cc:addr:python-list': 0.16; 'wrote:': 0.18; 'cc:no real name:2**0': 0.20; 'written': 0.20; 'trying': 0.21; '(most': 0.21; '(but': 0.21; 'wrote': 0.22; 'header:In-Reply-To:1': 0.22; 'fine,': 0.23; 'cc:2**0': 0.24; 'traceback': 0.24; 'module': 0.26; "i'm": 0.26; 'import': 0.27; 'raise': 0.28; 'urls': 0.28; 'skip:" 30': 0.28; 'problem': 0.29; 'cc:addr:python.org': 0.29; 'server': 0.30; 'keeps': 0.30; 'can.': 0.30; 'subject:?': 0.31; 'thanks': 0.31; 'anyone': 0.31; 'version': 0.32; 'header:User-Agent:1': 0.33; 'causing': 0.34; "we're": 0.34; 'last):': 0.34; 'see,': 0.34; 'issue': 0.35; 'running': 0.35; 'test': 0.35; 'response': 0.35; 'file': 0.36; 'but': 0.37; 'run': 0.37; 'machine': 0.37; 'received:192': 0.37; 'think': 0.37; 'open': 0.38; 'some': 0.38; 'skip:o 20': 0.38; 'client': 0.39; 'why': 0.39; "it's": 0.40; 'might': 0.40; 'received:192.168': 0.40; 'your': 0.61; 'header:Received:6': 0.61; 'our': 0.64; 'received:62': 0.70; 'informations': 0.71; 'execution.': 0.84; 'opener': 0.84; 'powell': 0.84; 'data)': 0.91 X-IronPort-AV: E=Sophos;i="4.71,279,1320620400"; d="scan'208";a="19218" X-Virus-Scanned: amavisd-new at zimbra.sequans.com Date: Thu, 01 Dec 2011 19:41:59 +0100 From: Jean-Michel Pichavant User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100328) MIME-Version: 1.0 To: Adrian Powell Subject: Re: platform issues? References: <20111201124122.8818@web003.roc2.bluetie.com> In-Reply-To: <20111201124122.8818@web003.roc2.bluetie.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Python-list@python.org 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: 49 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1322764928 news.xs4all.nl 6868 [2001:888:2000:d::a6]:49389 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:16508 Adrian Powell wrote: > I'm new to python and I'm trying to get a twitter client running on a new machine but it keeps on failing. I tracked the problem down to an issue opening URLs and wrote this little test case: > > import urllib2 > url = 'http://www.google.com/' > opener = urllib2.build_opener() > url_data = opener.open(url).read > url_data > > > When I run that on a dev machine it works fine, but when it's on one of our servers it crashes: > > >>>> import urllib2 >>>> url = 'http://www.google.com/' >>>> opener = urllib2.build_opener() >>>> url_data = opener.open(url).read >>>> > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.7/urllib2.py", line 391, in open > response = self._open(req, data) > File "/usr/lib/python2.7/urllib2.py", line 409, in _open > '_open', req) > File "/usr/lib/python2.7/urllib2.py", line 369, in _call_chain > result = func(*args) > File "/usr/lib/python2.7/urllib2.py", line 1173, in http_open > return self.do_open(httplib.HTTPConnection, req) > File "/usr/lib/python2.7/urllib2.py", line 1148, in do_open > raise URLError(err) > urllib2.URLError: > > > Our servers have the same version of python and we're running the same OS (Fedora 14). Can anyone think of what might be causing this problem, or why it works on most (but not all) machines? > > Thanks > Actually, Python did not crashed, some module raised an exception and nothing has been written to handle that exception, hence python stopping. But as you can see, python gave you a lot of meaningful informations about why it was not able to continue execution. urllib2.URLError: Your server may not be able to resolve that URL while your local dev machine can. JM