From eb4de8ae0cc37e38e9fa801f729e68d1f71a0bb0 Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Sat, 8 Jan 2022 18:14:43 +0100 Subject: [PATCH] Ignore 1970 dates as windows crashes when calling .timestamp() --- PFERD/output_dir.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PFERD/output_dir.py b/PFERD/output_dir.py index 0fb9911..e612267 100644 --- a/PFERD/output_dir.py +++ b/PFERD/output_dir.py @@ -231,7 +231,8 @@ class OutputDirectory: stat = local_path.stat() remote_newer = None - if mtime := heuristics.mtime: + if heuristics.mtime and heuristics.mtime.year > 1970: + mtime = heuristics.mtime remote_newer = mtime.timestamp() > stat.st_mtime if remote_newer: log.explain("Remote file seems to be newer")