Message91972
| Author |
kmoon |
| Recipients |
kmoon |
| Date |
2009年08月26日.13:51:30 |
| SpamBayes Score |
1.4773038e-07 |
| Marked as misclassified |
No |
| Message-id |
<1251294693.63.0.748199046509.issue6785@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
(I'm brand new to Python.org, apologies in advance if this has been
recorded elsewhere or is not a bug)
I've a simple script which fetching a url using httplib/urllib2 and then
simply searches the HTML for a string. Works on every URL I've tried
apart from the url http://peakoil.mobi where, for some reason, I get the
following:
Traceback (most recent call last):
File "C:\Python26\lib\threading.py", line 524, in __bootstrap_inner
self.run()
File "test.py", line 59, in run
html = response.read()
File "C:\Python26\lib\socket.py", line 327, in read
data = self._sock.recv(rbufsize)
File "C:\Python26\lib\httplib.py", line 518, in read
return self._read_chunked(amt)
File "C:\Python26\lib\httplib.py", line 564, in _read_chunked
raise IncompleteRead(value)
IncompleteRead: <html><head>
<title></title></head>
<!-- Redirection Services ASH01WRED02 H1 -->
<frameset rows='100%, *' frameborder=no framespacing=0 border=0>
<frame src="http://peakoil.com/modules.php?name=AvantGo" name=mainwindow
framebo
rder=no framespacing=0 marginheight=0 marginwidth=0></frame>
</frameset>
<noframes>
<h2>Your browser does not support frames. We recommend upgrading your
browser.<
/h2><br><br>
<center>Click <a
href="http://peakoil.com/modules.php?name=AvantGo">here</a> to
enter the site.</center>
</noframes></html>
Exception in thread 1:
Traceback (most recent call last):
File "C:\Python26\lib\threading.py", line 524, in __bootstrap_inner
self.run()
File "test.py", line 51, in run
response = urllib2.urlopen(req)
File "C:\Python26\lib\urllib2.py", line 124, in urlopen
return _opener.open(url, data, timeout)
File "C:\Python26\lib\urllib2.py", line 383, in open
response = self._open(req, data)
File "C:\Python26\lib\urllib2.py", line 401, in _open
'_open', req)
File "C:\Python26\lib\urllib2.py", line 361, in _call_chain
result = func(*args)
File "C:\Python26\lib\urllib2.py", line 1130, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "C:\Python26\lib\urllib2.py", line 1103, in do_open
r = h.getresponse()
File "C:\Python26\lib\httplib.py", line 951, in getresponse
response.begin()
File "C:\Python26\lib\httplib.py", line 391, in begin
version, status, reason = self._read_status()
File "C:\Python26\lib\httplib.py", line 355, in _read_status
raise BadStatusLine(line)
BadStatusLine |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2009年08月26日 13:51:33 | kmoon | set | recipients:
+ kmoon |
| 2009年08月26日 13:51:33 | kmoon | set | messageid: <1251294693.63.0.748199046509.issue6785@psf.upfronthosting.co.za> |
| 2009年08月26日 13:51:32 | kmoon | link | issue6785 messages |
| 2009年08月26日 13:51:30 | kmoon | create |
|