Question about using cookielib in python 2.4

John J. Lee jjl at pobox.com
Fri Mar 30 19:58:27 EDT 2007


Marko.Cain.23 at gmail.com writes:

> Hi,
> I am following the example of Python cookbook (14.7) about using
> cookielib in python2.4
> 
>  cj = cookielib.LWPCookieJar()
> //.... code to send out the request
>     print "Coookie-------------------------"
>             if cj is not None:
>                 for index, cookie in enumerate(cj):
>                     print index, ': ' , cookie
>                 cj.save(COOKIEFILE)
> 
> My question is I see cookie being printed in the above code,
> but when I do a 'more ' of the Cookie file, it is empty?
> 
> This is what I see on the screen:
> 
> Coookie-------------------------
> 0 :  <Cookie Test-ID=swmfp2caw065kswg for .vision5.abc.com/>
> 
> but when I more the 'cookie file', it is empty?
> 
> $ more cookies.lwp
> #LWP-Cookies-2.0
> $

I think I can guess, but post the code and I'll tell you for sure (if
it's the same as V1 of the cookbook, all the code is BSD license, so
you're at liberty to do so).


John



More information about the Python-list mailing list