msg179777 - (view) |
Author: C19 (C19) |
Date: 2013-01-12 08:12 |
Is it means that we should use MozillaCookieJar LWPCookieJar or MSIECookieJar? But the document says "perhaps save cookies to, a file on disk. " http://docs.python.org/2/library/cookielib.html?highlight=filecookiejar#cookielib.FileCookieJar it looks like FileCookieJar is just a base class.it shouldn't be used on normal purpose(like save your cookie).then the document should be modified. but I think it's better to make the FileCookieJar works as expected. |
|
|
msg179778 - (view) |
Author: C19 (C19) |
Date: 2013-01-12 08:22 |
# TODO(jhylton): Should this be redesigned to handle # persistent connections? # We want to make an HTTP/1.1 request, but the addinfourl # class isn't prepared to deal with a persistent connection. # It will try to read all remaining data from the socket, # which will block while the server waits for the next request. # So make sure the connection gets closed after the (only) # request. headers["Connection"] = "close" http://bugs.python.org/issue9740 this has been a long time..how many is annoyed by this..Count me in.. persistent connections may not be easy on various OS and act the same. I'm just satisfied if it works on linux. |
|
|
msg179780 - (view) |
Author: C19 (C19) |
Date: 2013-01-12 08:36 |
https://github.com/shazow/urllib3 do we really have to use a 3rd party module for this ?.. |
|
|
msg179793 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2013-01-12 13:52 |
Please open a separate issue for your enhancement request in your second message (assuming there isn't already one open). I'm not sure what your third message is about, but it also sounds off topic for your original bug report. For the FileCookieJar issue, I agree that the documentation is unclear. However, it is perfectly reasonable to have a documented base class that is an Abstract Base Class, and there is no reason for us to invent our own unique cookie file format just to make FileCookieJar work by itself. ABCs didn't exist when FileCookieJar was implemented, so it should be turned in to one for 3.4 (it might break working code, so we shouldn't do that for bug fix releases). That way you would get a useful error when you try to instantiate it, rather than when you try to use it. And the docs should document it as being a base-class-only for all active releases. |
|
|
msg182845 - (view) |
Author: Demian Brecht (demian.brecht) *  |
Date: 2013-02-24 01:18 |
I've changed FileCookieJar to use the ABCMeta metaclass and updated the concrete implementations. If this patch looks sufficient, I'll make an update to the docs as well. |
|
|
msg183020 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2013-02-26 05:53 |
+class FileCookieJar(CookieJar, metaclass=ABCMeta): + """Abstract Base Class for any file-based CookieJar.""" Is it just me or is it a bit strange to derive an abstract base class from a concrete class? Is CookieJar meant to be directly used? + with open(self.filename) as f: + magic = f.readline() + if not self.magic_re.search(magic): + f.close() + raise LoadError( + "%r does not look like a Netscape format cookies f.close() seems not needed as doing that in __exit__ as a major point of with open... statements. |
|
|
msg183103 - (view) |
Author: Demian Brecht (demian.brecht) *  |
Date: 2013-02-27 00:45 |
http://bugs.python.org/issue1690 seems to be a duplicate of this one (at least the initial report). 16901 (imho) is documented more clearly than this one, so can this one be closed as duplicate? |
|
|
msg186270 - (view) |
Author: Demian Brecht (demian.brecht) *  |
Date: 2013-04-08 04:06 |
Just noticed there was a typo in the link in my previous post. It should be directing to issue# 16901. |
|
|
msg187444 - (view) |
Author: Senthil Kumaran (orsenthil) *  |
Date: 2013-04-20 17:48 |
Agree with Demian Brecht. This issue is being closed in when two issues cover the requirements discussed here. * issue# 16901 - For Enhancing FileCookieJar * issue# 9740 - For supporting persistant HTTP 1.1 connections. (:-( on me) |
|
|