Response.set_cookie is documented to have an expires argument that's a datetime.timedelta type. However, if max_age is None, a datetime.timedelta type will result in an error: TypeError: unsupported operand type(s) for -: 'datetime.timedelta' and 'datetime.datetime'. The guilty line is 778 in response.py:
elif max_age is None and expires is not None:
max_age = expires - datetime.utcnow()
This is WebOb 1.4.
A workaround is to use a datetime.datetime, which, although undocumented, works fine.
Response.set_cookieis documented to have anexpiresargument that's adatetime.timedeltatype. However, ifmax_ageisNone, adatetime.timedeltatype will result in an error:TypeError: unsupported operand type(s) for -: 'datetime.timedelta' and 'datetime.datetime'. The guilty line is 778 inresponse.py:This is WebOb 1.4.
A workaround is to use a
datetime.datetime, which, although undocumented, works fine.