From 8fb2bc0ac02626c9589e4e25244dd47eea21d3f5 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 18 Sep 2017 11:35:08 +0200 Subject: [PATCH] windows can't handle 0 timestamps --- main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 6667581..98f94a0 100755 --- a/main.py +++ b/main.py @@ -309,8 +309,11 @@ def parse_repo(repo, repo_variant, url): @app.template_filter('timestamp') def _jinja2_filter_timestamp(d): - return datetime.datetime.fromtimestamp( - int(d)).strftime('%Y-%m-%d %H:%M:%S') + try: + return datetime.datetime.fromtimestamp( + int(d)).strftime('%Y-%m-%d %H:%M:%S') + except OSError: + return "-" @app.template_filter('filesize')