[Python-bugs-list] [Bug #119707] urllib failure when return code not 200

noreply@sourceforge.net noreply@sourceforge.net
Tue, 12 Dec 2000 13:17:50 -0800


Bug #119707, was updated on 2000-Oct-29 16:11
Here is a current snapshot of the bug.

Project: Python
Category: Library
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Submitted by: nobody
Assigned to : jhylton
Summary: urllib failure when return code not 200

Details: urllib fails sometimes.

A traceback follows but the problem is that, on line 286, fp is used as a parameter when it has a value of None. Not sure why; HTTP.getreply seems like it always returns a file. Not time right now to look further into it...

brian@sweetapp.com

Traceback (most recent call last):
  File "/usr/home/sweetapp/public_html/zonewatcher/Rating", line 83, in ?
    UpdatePlayerRatings( database, zonePlayer )
  File "/usr/home/sweetapp/public_html/zonewatcher/Rating", line 59, in UpdatePlayerRatings
    mainRatings = GetMainRatings( zonePlayer.GetZoneName( ), AOEIImainRating, AOEIIexpansionMainRating )
  File "/usr/home/sweetapp/public_html/zonewatcher/Rating", line 20, in GetMainRatings
    ratingsPage = GetRatingsPage( zoneID )
  File "/usr/home/sweetapp/public_html/zonewatcher/Rating", line 14, in GetRatingsPage
    url = urllib.urlopen( 'http://www.zone.com/Profile/RatingsPlayer.asp?PlayerID=' + zoneID )
  File "/usr/home/sweetapp/Python-2.0/Lib/urllib.py", line 61, in urlopen
    return _urlopener.open(url)
  File "/usr/home/sweetapp/Python-2.0/Lib/urllib.py", line 166, in open
    return getattr(self, name)(url)
  File "/usr/home/sweetapp/Python-2.0/Lib/urllib.py", line 286, in open_http
    return self.http_error(url, fp, errcode, errmsg, headers)
  File "/usr/home/sweetapp/Python-2.0/Lib/urllib.py", line 303, in http_error
    return self.http_error_default(url, fp, errcode, errmsg, headers)
  File "/usr/home/sweetapp/Python-2.0/Lib/urllib.py", line 518, in http_error_default
    return addinfourl(fp, headers, "http:" + url)
  File "/usr/home/sweetapp/Python-2.0/Lib/urllib.py", line 772, in __init__
    addbase.__init__(self, fp)
  File "/usr/home/sweetapp/Python-2.0/Lib/urllib.py", line 726, in __init__
    self.read = self.fp.read
AttributeError: 'None' object has no attribute 'read'

Follow-Ups:

Date: 2000-Dec-12 13:17
By: gvanrossum

Comment:
Jeremy, can you see if this is a valid bug report?

-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=119707&group_id=5470