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


Groups > comp.lang.python > #89942

urllib2.urlopen error "socket.error: [Errno 104] Connection reset by peer"

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!Xbb.tags.giganews.com!border1.nntp.ams1.giganews.com!nntp.giganews.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <jia.j.chen@foxmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.019
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'subject:error': 0.03; 'subject:: [': 0.04; 'subject:reset': 0.07; 'url:products': 0.07; 'urllib2': 0.07; 'subject:peer': 0.09; 'python': 0.11; 'clues': 0.16; 'data)': 0.16; 'issue?': 0.16; 'subject:skip:u 10': 0.16; 'timeout)': 0.16; 'trying': 0.19; 'subject:] ': 0.20; 'thanks.': 0.20; '>>>': 0.22; 'import': 0.22; 'reset': 0.22; 'error': 0.23; '&gt;&gt;&gt;': 0.24; 'skip:" 30': 0.26; '"",': 0.31; 'file': 0.32; 'open': 0.33; '(most': 0.33; 'to:name:python-list': 0.33; 'skip:_ 10': 0.34; 'there,': 0.34; 'could': 0.34; 'connection': 0.35; 'problem.': 0.35; 'skip:s 30': 0.35; 'skip:u 20': 0.35; 'data,': 0.36; 'ubuntu': 0.36; 'skip:& 10': 0.38; 'version,': 0.38; 'to:addr:python-list': 0.38; 'recent': 0.39; 'skip:& 20': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'skip:u 10': 0.60; 'solve': 0.60; 'subject:"': 0.60; 'browser': 0.61; 'from:charset:utf-8': 0.61; 'more': 0.64; 'mar': 0.68; 'webpage': 0.68; '2014,': 0.84; 'getresponse': 0.84; 'message-id:@qq.com': 0.84; 'received:qq.com': 0.84; 'x-mailer:qqmail 2.x': 0.84
X-QQ-FEAT KC9GRaXB0GoiY0C7qI8vbusqUgjuBb3j8gdW3W/bixLEgdd0W6NJQCL0hJhw9 pGynOoRauyVDeARZhhyz9slVy4vPQTsouZLU8l1jD2+EsFfDsfeka6w2zWOD6jU4BUMs2Be hYfR5/YkaHQJf0iru7ZCE5y5FdNjibVP3OAJrydY9u6j0p1fzGWeAiEx+crYl1j5YyX2EmR zf6lIx5P3vblgEu43Epe1
X-QQ-SSF 00000000000000F0000000000000000
X-HAS-ATTACH no
X-QQ-BUSINESS-ORIGIN 2
X-Originating-IP 204.44.225.204
X-QQ-STYLE
X-QQ-mid webmail638t1430793683t5755369
From "Jia CHEN" <jia.j.chen@foxmail.com>
To "python-list" <python-list@python.org>
Subject urllib2.urlopen error "socket.error: [Errno 104] Connection reset by peer"
Mime-Version 1.0
Content-Type multipart/alternative; boundary="----=_NextPart_55482DD3_095228F8_7C18B5AC"
Content-Transfer-Encoding 8Bit
Date Tue, 5 May 2015 10:41:23 +0800
X-Priority 3
X-QQ-MIME TCMime 1.0 by Tencent
X-Mailer QQMail 2.x
X-QQ-Mailer QQMail 2.x
X-QQ-SENDSIZE 520
X-QQ-FName 326E9DD5CA6C43D3B80F63313AAA82A0
X-QQ-LocalIP 112.95.241.173
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.109.1430793765.12865.python-list@python.org> (permalink)
Lines 142
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1430793765 news.xs4all.nl 2854 [2001:888:2000:d::a6]:51109
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:89942

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi There,
 
I have the error below when trying to download the html content of a webpage. I can open this webpage in a browser without any problem. I am using Ubuntu 14.04. Could you give me come clues about what is happening and how to solve the issue? Thanks.
 
$python 
 
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
 
[GCC 4.8.2] on linux2
 
Type "help", "copyright", "credits" or "license" for more information.
 
>>> import urllib2
 
request = urllib2.Request('http://guggenheiminvestments.com/products/etf/gsy/holdings')
 
response = urllib2.urlopen(request)
 
>>> >>> Traceback (most recent call last):
 
File "<stdin>", line 1, in <module>
 
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
 
return _opener.open(url, data, timeout)
 
File "/usr/lib/python2.7/urllib2.py", line 404, in open
 
response = self._open(req, data)
 
File "/usr/lib/python2.7/urllib2.py", line 422, in _open
 
'_open', req)
 
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
 
result = func(*args)
 
File "/usr/lib/python2.7/urllib2.py", line 1214, in http_open
 
return self.do_open(httplib.HTTPConnection, req)
 
File "/usr/lib/python2.7/urllib2.py", line 1187, in do_open
 
r = h.getresponse(buffering=True)
 
File "/usr/lib/python2.7/httplib.py", line 1045, in getresponse
 
response.begin()
 
File "/usr/lib/python2.7/httplib.py", line 409, in begin
 
version, status, reason = self._read_status()
 
File "/usr/lib/python2.7/httplib.py", line 365, in _read_status
 
line = self.fp.readline(_MAXLINE + 1)
 
File "/usr/lib/python2.7/socket.py", line 476, in readline
 
data = self._sock.recv(self._rbufsize)
 
socket.error: [Errno 104] Connection reset by peer
 
>>>

Best,

Jia CHEN

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


Thread

urllib2.urlopen error "socket.error: [Errno 104] Connection reset by peer" "Jia CHEN" <jia.j.chen@foxmail.com> - 2015-05-05 10:41 +0800

csiph-web