From 74c9e2e42136e9a1d663f757cbedeff06848cf1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sidor?= Date: Fri, 27 Sep 2019 22:53:02 +0200 Subject: [PATCH] Change date format passed to touch command GNU touch accepts pretty much any format, while BSD touch is only happy with ISO format. This commit is motivated by my attempts to run oioioi on FreeBSD. --- filetracker/servers/storage.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/filetracker/servers/storage.py b/filetracker/servers/storage.py index 7c5812d..29660f1 100644 --- a/filetracker/servers/storage.py +++ b/filetracker/servers/storage.py @@ -27,7 +27,6 @@ from __future__ import print_function import contextlib -import email.utils import errno import fcntl import gevent @@ -481,7 +480,7 @@ def _makedirs(path): def lutime(path, time): if six.PY2: - t = email.utils.formatdate(time) + t = time.isoformat() if subprocess.call(['touch', '-c', '-h', '-d', t, path]) != 0: raise RuntimeError else: