ANN: ClientCookie 1.0.2 released
John J. Lee
jjl at pobox.com
Tue Jan 18 22:49:30 CET 2005
http://wwwsearch.sourceforge.net/ClientCookie/
1.0.2 is the first stable release of a "final" version, parts of which
are in Python 2.4 as new module cookielib and updates to urllib2.
0.4.x is no longer actively maintained.
This release requires Python 2.0 or newer. Python 1.5.2 is no longer
supported.
Notes about ClientCookie, cookielib and urllib2
1. The cookie handling parts of ClientCookie are in Python 2.4
standard library as module cookielib and extensions to module
urllib2.
2. ClientCookie works with Python 2.4.
3. For new code to run on Python 2.4, I recommend use of standard
library modules urllib2 and cookielib instead of ClientCookie.
4. Handler classes thst are missing from 2.4's urllib2
(eg. HTTPRefreshProcessor) may be used with 2.4's
urllib2. IMPORTANT: For all other code, use ClientCookie
exclusively: do NOT mix use of ClientCookie and urllib2!
For a list of backwards-incompatible changes from 0.4.x to 1.0.x, see:
http://wwwsearch.sourceforge.net/ClientCookie/porting-0.4-1.0.txt
Changes from 1.0.0a to 1.0.2:
* Remove thread synchronization from CookieJar, since I'm convinced
it's broken.
* Cookies previously considered to have no name are now considered as
if they had no value. This was half-done in 1.0.0a and in Python
2.4.0 cookielib (ie., it was broken). Note that this may break
existing LWPCookieJar files if they contain such cookies
(MozillaCookieJar files are OK).
* Don't lowercase cookie names if they happen to be one of the
special cookie-attribute names (eg. Expires).
* Fix bug in LWPCookieJar. and MozillaCookieJar.load() (raise
ClientCookie.LoadError, not IOError, on failure).
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, automatic observance of robots.txt 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.
import ClientCookie
response = ClientCookie.urlopen("http://foo.bar.com/")
This function behaves identically to urllib2.urlopen, except that it
deals with cookies automatically. That's probably all you need to
know.
John
More information about the Python-announce-list
mailing list