ClientCookie

Michael Foord fuzzyman at gmail.com
Mon Aug 23 10:40:30 EDT 2004


jjl at pobox.com (John J. Lee) wrote in message news:<87llgbt2mh.fsf at pobox.com>...
> fuzzyman at gmail.com (Michael Foord) writes:
> > jjl at pobox.com (John J. Lee) wrote in message news:<87ekmcp13g.fsf at pobox.com>...
>  [...]
> > No - I was following hte docs - which just shows CookieJar IIRC :-)
> > Now that I'm using LWPCookieJar everything is wonderful and works fine...
> [...]
> 
> Whoops, sorry.  Where is this mistake in the docs?  I don't see it.
> 
> 
> John

Right...
I'm using the document that starts :
ClientCookie
Note: this page describes the 0.9.x development version. See here for
the stable 0.4.x version.


There is no mention of LWPCookieJar *anywhere* in the docs.
In the debugging  section it talks about using the load and save
method and gives a specific example involving the straight CookieJar
class....... :

When you .save() to or .load()/.revert() from a file, single-session
cookies will expire unless you explicitly request otherwise with the
ignore_discard argument. This may be your problem if you find cookies
are going away after saving and loading.

import ClientCookie
cookies = ClientCookie.CookieJar()
opener = ClientCookie.build_opener(ClientCookie.HTTPCookieProcessor(cookies))
ClientCookie.install_opener(opener)
r = ClientCookie.urlopen("http://foobar.com/")
cookies.save("/some/file", ignore_discard=True, ignore_expires=True)



These are the docs that came with my download...............
LWPCookieJar - works fine.... but I'd never heard of it until you
mentioned it.

Regards,


Fuzzy

http://www.voidspace.org.uk/atlantibots/pythonutils.html



More information about the Python-list mailing list