New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cookielib LWPCookieJar and MozillaCookieJar exceptions #41534
Comments
cookielib.LWPCookieJar and .MozillaCookieJar are I think this should be backported to the 2.4 |
Logged In: YES I often look at the code in a second idle window rather Would it work to make LoadError a subclass of IOError, at Should LoadError be a subclass of IOError even in the |
Logged In: YES Jim, I don't understand the first sentence in your comment. Re a 2.4 backport that makes LoadError derive from IOError: No, LoadError should not be a subclass of IOError in the |
Logged In: YES The first sentence was pointing out that many people While I don't yet have code catching this particular error, I So I would definately prefer that it remain (at least a |
Logged In: YES I agree the backport (but not the trunk) should have I'd be happy for comments to go in noting the change in all Any committers reading: should I submit an updated patch (Jim: Besides the point for the matter at hand, but I should |
Logged In: YES Is it true that LoadError is currently not used anywhere? If |
Logged In: YES LoadError is not currently not used anywhere. Without LoadError, how would one distinguish (for the |
Logged In: YES Can you give an example of an invalid cookies file? How does |
Logged In: YES >>> open('bad_cookies.txt', 'w').write("blah")
>>> import cookielib
>>> mcj = cookielib.MozillaCookieJar(filename="bad_cookies.txt")
>>> mcj.load()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "c:\Python24\lib\cookielib.py", line 1727, in load
self._really_load(f, filename, ignore_discard,
ignore_expires)
File "c:\Python24\lib\_MozillaCookieJar.py", line 53, in
_really_load
raise IOError(
IOError: bad_cookies.txt does not look like a Netscape
format cookies file
>>> |
Logged In: YES I see. In retrospect, it might have been best to reject the Therefore, I now propose that LoadError becomes a subclass a |
Logged In: YES Re IOError: OK, I'll submit a revised patch. Yes, I agree on your first para, with hindsight. I Thanks for your attention to these bugs. |
Logged In: YES Revised patch attached. |
Logged In: YES This comment is not relevant to the patch, just a comment on
Hmm, that's not true: four bugs might have been picked up if OTOH, no guilt on 1117339 or 1028908 (except regret that I |
Logged In: YES Patch loaderror_v2.patch implements MvL's suggestion (see It still applies cleanly (except that 'patch' doesn't like Can it be committed, and preferably backported to the 2.4 |
Logged In: YES jjlee> It still applies cleanly (except that 'patch' doesn't Sorry, FWLIW, it *does* apply cleanly, I just had the wrong |
Logged In: YES OK, another patch applied since March causes loaderror_v3.patch fixes that. |
Logged In: YES Should there be doc changes for LoadError subclassing IOError? Committed revision 41798. |
Logged In: YES Thanks Neil (and thanks for applying my other cookielib patch). I've attached a doc patch. I don't like to repeat the The re-raise should not be changed, since CookieJar.load() |
Logged In: YES jjlee> and was always documented as such To be precise, it was documented under .revert(). I attach |
Logged In: YES I updated the docs from the v2 patch. It doesn't seem to I didn't love the duplication, but it's not a big deal, so I Committed revision 41887. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: