1. Mariano Mara
  2. WebObTestCoverage

Commits

ianb  committed 80acaed

Fixed #287, not converting timedelta's in set_cookie properly

  • Participants
  • Parent commits 6bc81f1
  • Branches default

Comments (0)

Files changed (3)

File docs/differences.txt

View file
 Response
 --------
 
-default ``content_type``:
-    The base Response object has no default content_type or charset.
-    You can set ``default_content_type`` in a subclass.
-
 ``determine_charset()``:
     Is now available as ``res.charset``
 
     In ``res.status_int``
 mimetype:
     In ``res.content_type``
-write(data):
-    With ``res.body_file.write(data)``
 
 Zope 3
 ======

File docs/news.txt

View file
 
 .. contents::
 
+svn trunk
+---------
+
+* Fixed ``resp.set_cookie(max_age=timedelta(...))``
+
 0.9.2
 -----
 

File webob/__init__.py

View file
         cookies = BaseCookie()
         cookies[key] = value
         if isinstance(max_age, timedelta):
-            max_age = timedelta.seconds + timedelta.days*24*60*60
+            max_age = max_age.seconds + max_age.days*24*60*60
         if max_age is not None and expires is None:
             expires = datetime.utcnow() + timedelta(seconds=max_age)
         if isinstance(expires, timedelta):