Subsections

11 New, Improved, and Deprecated Modules

As usual, Python's standard library received a number of enhancements and bug fixes. Here's a partial list of the most notable changes, sorted alphabetically by module name. Consult the Misc/NEWS file in the source tree for a more complete list of changes, or look through the CVS logs for all the details.

11.1 cookielib

The cookielib library supports client-side handling for HTTP cookies, just as the Cookie provides server-side cookie support in CGI scripts. Cookies are stored in cookie jars; the library transparently stores cookies offered by the web server in the cookie jar, and fetches the cookie from the jar when connecting to the server. Similar to web browsers, policy objects control whether cookies are accepted or not.

In order to store cookies across sessions, two implementations of cookie jars are provided: one that stores cookies in the Netscape format, so applications can use the Mozilla or Lynx cookie jars, and one that stores cookies in the same format as the Perl libwww libary.

urllib2 has been changed to interact with cookielib: HTTPCookieProcessor manages a cookie jar that is used when accessing URLs.

11.2 doctest

The doctest module underwent considerable refactoring thanks to Edward Loper and Tim Peters.

See About this document... for information on suggesting changes.