Sergey Prigogin <sprigo...@google.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5952>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to