# HG changeset patch # User Alexandre Fayolle # Date 1321269228 -3600 # Node ID 1c37783ff6107df1c226172b47315e6ee7a34fbb # Parent 623432dc1deb2780d4e0454aad8af79af14bfe2e# Parent e8091b415ad8e7d17936afcce4ff03639d319e8b merge stable changes to default diff -r 623432dc1deb -r 1c37783ff610 web/http_headers.py --- a/web/http_headers.py Thu Nov 10 10:13:40 2011 +0100 +++ b/web/http_headers.py Mon Nov 14 12:13:48 2011 +0100 @@ -744,7 +744,8 @@ def generateDateTime(secSinceEpoch): """Convert seconds since epoch to HTTP datetime string.""" - year, month, day, hh, mm, ss, wd, y, z = time.gmtime(secSinceEpoch) + # take care gmtime doesn't handle time before epoch (crash on windows at least) + year, month, day, hh, mm, ss, wd, y, z = time.gmtime(max(0, secSinceEpoch)) s = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % ( weekdayname[wd], day, monthname[month], year, diff -r 623432dc1deb -r 1c37783ff610 web/request.py --- a/web/request.py Thu Nov 10 10:13:40 2011 +0100 +++ b/web/request.py Mon Nov 14 12:13:48 2011 +0100 @@ -554,7 +554,11 @@ warn('[3.13] remove_cookie now take only a name as argument', DeprecationWarning, stacklevel=2) name = bwcompat - self.set_cookie(name, '', maxage=0, expires=date(1970, 1, 1)) + self.set_cookie(name, '', maxage=0, + # substracting GMTOFFSET because set_cookie + # expects a localtime and we don't want to + # handle times before the EPOCH + expires=date(1970, 1, 1) - GMTOFFSET) def set_content_type(self, content_type, filename=None, encoding=None): """set output content type for this request. An optional filename