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


Groups > comp.lang.python > #16505 > unrolled thread

platform issues?

Started by"Adrian Powell" <adrianp@bringtechnology.com>
First post2011-12-01 12:41 -0500
Last post2011-12-01 18:00 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  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

#16505 — platform issues?

From"Adrian Powell" <adrianp@bringtechnology.com>
Date2011-12-01 12:41 -0500
Subjectplatform issues?
Message-ID<mailman.3204.1322761291.27778.python-list@python.org>
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

[toc] | [next] | [standalone]


#16506

FromRedcat <redcat@catfolks.net>
Date2011-12-01 18:00 +0000
Message-ID<9jptm8Fug2U9@mid.individual.net>
In reply to#16505
> 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

Is the server able to resolve www.google.com properly? If so, are you 
POSITIVE that the "url = " line on the server has no typos?

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web