Fixes a bug in web.py. See #208. PR is waiting to be merged upstream at https://github.com/webpy/webpy/pull/419
    TODO: remove me once PR is merged upstream.

def fix_webpy_cookies():
    """
    Fixes a bug in web.py. See #208. PR is waiting to be merged upstream at https://github.com/webpy/webpy/pull/419
    TODO: remove me once PR is merged upstream.
    """

    try:
        web.webapi.parse_cookies('a="test"')  # make the bug occur
    except NameError:
        # monkeypatch web.py
        SimpleCookie.iteritems = SimpleCookie.items
        web.webapi.Cookie = namedtuple('Cookie', ['SimpleCookie', 'CookieError'])(SimpleCookie, CookieError)

    web.webapi.parse_cookies('a="test"')