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


Groups > comp.lang.python > #16505

platform issues?

Date 2011-12-01 12:41 -0500
From "Adrian Powell" <adrianp@bringtechnology.com>
Subject platform issues?
Newsgroups comp.lang.python
Message-ID <mailman.3204.1322761291.27778.python-list@python.org> (permalink)

Show all headers | View raw


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 "<stdin>", line 1, in <module>
  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: <urlopen error [Errno -2] Name or service not known>


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

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

platform issues? "Adrian Powell" <adrianp@bringtechnology.com> - 2011-12-01 12:41 -0500
  Re: platform issues? Redcat <redcat@catfolks.net> - 2011-12-01 18:00 +0000

csiph-web