class FixFancyURLOpener(FancyURLopener):

    def http_error_default(self, url, fp, errcode, errmsg, headers):
        if errcode == 403:
            raise ValueError('403')
return super(FixFancyURLOpener, self).http_error_default(url, fp, errcode,
    errmsg, headers)
urllib.request.FancyURLopener = FixFancyURLOpener
url = (
    """http://scholar.google.com/scholar.bib?q=info:K7uZdMSvdQ0J:scholar.google.com/&output=citation&hl=en&as_sdt=1,14&ct=citation&cd=0"""
    )
urllib.request.urlretrieve(url, 'cite0.bib')
How do I fix a ValueError: read of closed file exception?