feedparser icon indicating copy to clipboard operation
feedparser copied to clipboard

`ConnectionResetError` not handled

Open minusf opened this issue 2 years ago • 0 comments

It seems that ConnectionResetError is not handled when opening the feed in parse():

    try:
        data = _open_resource(url_file_stream_or_string, etag, modified, agent, referrer, handlers, request_headers, result)
    except urllib.error.URLError as error:
        result.update({
            'bozo': True,
            'bozo_exception': error,
        })
        return result

both ConnectionResetError and urllib.error.URLError are subclasses of OSError. Catching ConnectionError would take care of a lot of cases.

minusf avatar Apr 06 '22 20:04 minusf