From e467b38d739347d62cbb122d9f4752abe823b423 Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Sun, 9 Jan 2022 18:23:00 +0100 Subject: [PATCH] Only reject 1970 timestamps on windows --- PFERD/output_dir.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PFERD/output_dir.py b/PFERD/output_dir.py index e612267..441717b 100644 --- a/PFERD/output_dir.py +++ b/PFERD/output_dir.py @@ -231,7 +231,9 @@ class OutputDirectory: stat = local_path.stat() remote_newer = None - if heuristics.mtime and heuristics.mtime.year > 1970: + + # Python on Windows crashes when faced with timestamps around the unix epoch + if heuristics.mtime and (os.name != "nt" or heuristics.mtime.year > 1970): mtime = heuristics.mtime remote_newer = mtime.timestamp() > stat.st_mtime if remote_newer: