This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sprigogin
Recipients amaury.forgeotdarc, sprigogin
Date 2009-05-07.18:09:00
SpamBayes Score 0.0016718428
Marked as misclassified No
Message-id <1241719742.65.0.86394606902.issue5952@psf.upfronthosting.co.za>
In-reply-to
Content
The problem is pretty obvious from the code.

URLopener.open_http contains the following code:

        if data is not None:
            h.send(data)
        errcode, errmsg, headers = h.getreply()
        fp = h.getfile()
        if errcode == 200:
            return addinfourl(fp, headers, "http:" + url)
        else:
            if data is None:
                return self.http_error(url, fp, errcode, errmsg, headers)
            else:
                return self.http_error(url, fp, errcode, errmsg,
headers, data)

In case of an error h.getfile() may return None. self.http_error (line
322) is called with None fp. http_error calls self.http_error_default
(line 339). FancyURLopener.http_error_default calls addinfourl(fp,
headers, "http:" + url) (line 579), which expects fp to be not None.

For variety of reasons I cannot run this test case with a newer Python
version.
History
Date User Action Args
2009-05-07 18:09:02sprigoginsetrecipients: + sprigogin, amaury.forgeotdarc
2009-05-07 18:09:02sprigoginsetmessageid: <1241719742.65.0.86394606902.issue5952@psf.upfronthosting.co.za>
2009-05-07 18:09:00sprigoginlinkissue5952 messages
2009-05-07 18:09:00sprigogincreate