ANN: ClientCookie 0.4.11 released

John J. Lee jjl@pobox.com
16 Dec 2003 21:16:52 +0000


http://wwwsearch.sourceforge.net/ClientCookie/

Stable bugfix release, but with an interface change for anybody not
using the urllib2-workalike callables (ie. most people need not
worry).

Changes since 0.4.10:

 * Fixed a security bug.  Previously, cookies could end up being sent
   to a server when they shouldn't (this happened only when a redirect
   occurred from a server to which cookies were returned, to a server
   which should have no cookies returned: in that case, the cookie
   header got left unchanged after the redirection).
 * People using the urllib2-workalike callables need not worry about
   the following interface change (RequestUpgradeProcessor hides it):
   Request is now documented to require .add_unredirected_header(),
   .has_header(), .get_header() and .iter_headers() methods.  However,
   this will break code for people not using urllib2 (if so, you can
   probably just switch to using ClientCookie.Request, and use the new
   methods if you were poking about with Request.headers before).  I
   had to change this because it's needed for the security fix above.
 * Bugfix: Don't clobber Cookie or Cookie2 headers if they're already
   present in the request.
 * Fixed bug in CookieJar.clear(): didn't work with three arguments.


Requires Python >= 1.5.2.

ClientCookie is a Python module for handling HTTP cookies on the
client side, useful for accessing web sites that require cookies to be
set and then returned later.  It also provides some other (optional)
useful stuff: HTTP-EQUIV and Refresh handling, automatic adding of the
Referer [sic] header and lazily-seek()able responses.  These extras
are implemented using an extension that makes it easier to add new
functionality to urllib2.  It has developed from a port of Gisle Aas'
Perl module HTTP::Cookies, from the libwww-perl library.

Simple usage:

 import ClientCookie
 response = ClientCookie.urlopen("http://www.example.com/")

This function behaves identically to urllib2.urlopen, except that it
deals with cookies automatically.  That's probably all you need to
know.


John