From 4995e0c3f442d02dd9ebc79c6d605ca004bd9ee7 Mon Sep 17 00:00:00 2001 From: Santiago Gala Date: Mon, 15 Mar 2010 15:33:22 +0100 Subject: Round stats.st_mtime to seconds or it will fail with ext4 Not sure about other setups, but here (ext4) stats.st_mtime is a float, whicle parse_date return an integer, so it is almost impossible that the recorded Last-Modified is greater or equal than the st_mtime of the file. The patch fixes it. --- bottle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bottle.py b/bottle.py index d97cc23..35c139e 100755 --- a/bottle.py +++ b/bottle.py @@ -957,7 +957,7 @@ def static_file(filename, root, guessmime=True, mimetype=None, download=False): if ims: ims = ims.split(";")[0].strip() # IE sends "; length=146" ims = parse_date(ims) - if ims is not None and ims >= stats.st_mtime: + if ims is not None and ims >= int(stats.st_mtime): return HTTPResponse("Not modified", status=304, header=header) header['Content-Length'] = stats.st_size if request.method == 'HEAD': -- cgit v1.2.1