[Python-bugs-list] [ python-Bugs-219707 ] urllib failure when return code not 200

noreply@sourceforge.net noreply@sourceforge.net
Sat, 14 Jul 2001 21:13:44 -0700


Bugs item #219707, was opened at 2000-10-29 16:11
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=219707&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Jeremy Hylton (jhylton)
Summary: urllib failure when return code not 200

Initial Comment:
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'

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

Comment By: Andrew Gaul (gaul)
Date: 2001-07-14 21:13

Message:
Logged In: YES 
user_id=139865

I've spoken with brian@sweetapp.com, and neither he (with 
2.1) nor I (with 2.0) could reproduce this bug.  Have you 
had any luck Jeremey?

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2000-12-12 13:17

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


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

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=219707&group_id=5470