mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
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:
parent
b164dafebb
commit
3e7de59bd2
4 changed files with 36 additions and 10 deletions
|
@ -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."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue