From 43a19779c181eeb22734e2417b662e667d1a0ad7 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 15 Aug 2025 21:36:02 +0000 Subject: [PATCH] ftp: fix potential utime issue; closes #539 --- copyparty/ftpd.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/copyparty/ftpd.py b/copyparty/ftpd.py index 14f8d5b6..b7246291 100644 --- a/copyparty/ftpd.py +++ b/copyparty/ftpd.py @@ -409,8 +409,12 @@ class FtpFs(AbstractedFS): return st def utime(self, path: str, timeval: float) -> None: - ap = self.rv2a(path, w=True)[0] - return bos.utime(ap, (timeval, timeval)) + try: + ap = self.rv2a(path, w=True)[0] + return bos.utime(ap, (int(time.time()), int(timeval))) + except Exception as ex: + logging.error("ftp.utime: %s, %r", ex, ex) + raise def lstat(self, path: str) -> os.stat_result: ap = self.rv2a(path)[0]