Fix SF #1117398, cookielib LWPCookieJar and MozillaCookieJar exceptions

cookielib.LWPCookieJar and .MozillaCookieJar are documented to raise
cookielib.LoadError on attempt to load an invalid cookies file, but
raise IOError instead.  Compromise by having LoadError subclass IOError.
This commit is contained in:
Neal Norwitz 2005-12-23 21:24:35 +00:00
parent b164dafebb
commit 3e7de59bd2
4 changed files with 36 additions and 10 deletions

View file

@ -1682,7 +1682,8 @@ class CookieJar:
return "<%s[%s]>" % (self.__class__, ", ".join(r))
class LoadError(Exception): pass
# derives from IOError for backwards-compatibility with Python 2.4.0
class LoadError(IOError): pass
class FileCookieJar(CookieJar):
"""CookieJar that can be loaded from and saved to a file."""