#!/usr/bin/env python # The URL sets a cookie with an 'expires' attribute. import urllib2, cookielib cookie_jar = cookielib.CookieJar() request = urllib2.Request('http://gdyn.cnn.com/1.1/1.gif?1301540335193') conn = urllib2.urlopen(request) cookie_jar.make_cookies(conn, request) ''' # Output is: /usr/lib/python2.6/cookielib.py:1580: UserWarning: cookielib bug! Traceback (most recent call last): File "/usr/lib/python2.6/cookielib.py", line 1578, in make_cookies parse_ns_headers(ns_hdrs), request) File "/usr/lib/python2.6/cookielib.py", line 1535, in _cookies_from_attrs_set cookie = self._cookie_from_cookie_tuple(tup, request) File "/usr/lib/python2.6/cookielib.py", line 1507, in _cookie_from_cookie_tuple elif expires <= self._now: AttributeError: CookieJar instance has no attribute '_now' _warn_unhandled_exception() [] ''' ''' scott@toad:~/code/apsite$ python -V Python 2.6.5 scott@toad:~/code/apsite$ python -v # installing zipimport hook import zipimport # builtin # installed zipimport hook # /usr/lib/python2.6/site.pyc matches /usr/lib/python2.6/site.py import site # precompiled from /usr/lib/python2.6/site.pyc # /usr/lib/python2.6/os.pyc matches /usr/lib/python2.6/os.py import os # precompiled from /usr/lib/python2.6/os.pyc import errno # builtin import posix # builtin # /usr/lib/python2.6/posixpath.pyc matches /usr/lib/python2.6/posixpath.py import posixpath # precompiled from /usr/lib/python2.6/posixpath.pyc # /usr/lib/python2.6/stat.pyc matches /usr/lib/python2.6/stat.py import stat # precompiled from /usr/lib/python2.6/stat.pyc # /usr/lib/python2.6/genericpath.pyc matches /usr/lib/python2.6/genericpath.py import genericpath # precompiled from /usr/lib/python2.6/genericpath.pyc # /usr/lib/python2.6/warnings.pyc matches /usr/lib/python2.6/warnings.py import warnings # precompiled from /usr/lib/python2.6/warnings.pyc # /usr/lib/python2.6/linecache.pyc matches /usr/lib/python2.6/linecache.py import linecache # precompiled from /usr/lib/python2.6/linecache.pyc # /usr/lib/python2.6/types.pyc matches /usr/lib/python2.6/types.py import types # precompiled from /usr/lib/python2.6/types.pyc # /usr/lib/python2.6/UserDict.pyc matches /usr/lib/python2.6/UserDict.py import UserDict # precompiled from /usr/lib/python2.6/UserDict.pyc # /usr/lib/python2.6/_abcoll.pyc matches /usr/lib/python2.6/_abcoll.py import _abcoll # precompiled from /usr/lib/python2.6/_abcoll.pyc # /usr/lib/python2.6/abc.pyc matches /usr/lib/python2.6/abc.py import abc # precompiled from /usr/lib/python2.6/abc.pyc # /usr/lib/python2.6/copy_reg.pyc matches /usr/lib/python2.6/copy_reg.py import copy_reg # precompiled from /usr/lib/python2.6/copy_reg.pyc # /usr/lib/python2.6/sitecustomize.pyc matches /usr/lib/python2.6/sitecustomize.py import sitecustomize # precompiled from /usr/lib/python2.6/sitecustomize.pyc # /usr/lib/python2.6/dist-packages/apport_python_hook.pyc matches /usr/lib/python2.6/dist-packages/apport_python_hook.py import apport_python_hook # precompiled from /usr/lib/python2.6/dist-packages/apport_python_hook.pyc import encodings # directory /usr/lib/python2.6/encodings # /usr/lib/python2.6/encodings/__init__.pyc matches /usr/lib/python2.6/encodings/__init__.py import encodings # precompiled from /usr/lib/python2.6/encodings/__init__.pyc # /usr/lib/python2.6/codecs.pyc matches /usr/lib/python2.6/codecs.py import codecs # precompiled from /usr/lib/python2.6/codecs.pyc import _codecs # builtin # /usr/lib/python2.6/encodings/aliases.pyc matches /usr/lib/python2.6/encodings/aliases.py import encodings.aliases # precompiled from /usr/lib/python2.6/encodings/aliases.pyc # /usr/lib/python2.6/encodings/utf_8.pyc matches /usr/lib/python2.6/encodings/utf_8.py import encodings.utf_8 # precompiled from /usr/lib/python2.6/encodings/utf_8.pyc Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. dlopen("/usr/lib/python2.6/lib-dynload/readline.so", 2); import readline # dynamically loaded from /usr/lib/python2.6/lib-dynload/readline.so '''