ClientCookie bug (followup)

John J. Lee jjl at pobox.com
Wed Aug 27 07:54:24 EDT 2003


cartermark46 at ukmail.com (Mark Carter) writes:

[...]
> > All of this is explained in the web page, though. 
> 
> You are right! All the technical information is there. But can I
> suggest a change in the docs that might spell it out a bit more
> obviously to someone coming to the module from fresh? Something
> like:

Certainly!


[...]
> h2: Using Internet Explorer or Netscape/Mozilla cookies
> 
>     c = ClientCookie.MSIECookieJar(delayload=1) # see note 1
>     c.load_from_registry(username='joe bloggs') # see note 2
>     opener = ClientCookie.build_opener(ClientCookie.HTTPCookieProcessor(c))
> 
>     url = 'http://foo.bar.com/'
>     response = opener.open(url)
> 
>     print response.info()  # headers
>     print response.read()  # body

Possibly, but there's a balance to be struck between convenience and
documentation bloat.  Since "Cooperating with Netscape/Mozilla and
Internet Explorer" explains the CookieJar part, and the very next
section is "Using your own CookieJar instance", it seems to flow quite
well to me.  The first sentence of that section is kind of misleading
though, so I'll change that.

[...]
> 2. Usually only win98 and 95 users need supply the username. As an
> alternative
> to loading from the registry, consider using the line
>     c.load_cookie_data('cookie-file.txt')
> instead.

Thanks -- worthwhile addition.

[...]
> should be at the top, where people will see it first, and before
> those more complicated examples.

It is at the top -- after an example of the simplest usages and an
explanation of what CookieJar is actually for, which I think have to
come first.


John




More information about the Python-list mailing list