clamp lastmod to y6325 (closes #1470);

fromtimestamp fails on year>9999
This commit is contained in:
ed
2026-05-25 11:08:19 +00:00
parent 926c6e814d
commit 27031f73be
3 changed files with 6 additions and 5 deletions
+4 -3
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env python3
from __future__ import print_function, unicode_literals
S_VERSION = "2.20"
S_BUILD_DT = "2026-04-22"
S_VERSION = "2.21"
S_BUILD_DT = "2026-05-25"
"""
u2c.py: upload to copyparty
@@ -1311,7 +1311,8 @@ class Ctl(object):
if self.ar.jw:
print("%s %s" % (wark, vp))
else:
zd = datetime.datetime.fromtimestamp(max(0, file.lmod), UTC)
tsdt = datetime.datetime.fromtimestamp
zd = tsdt(max(0, min(2 << 36, file.lmod)), UTC)
dt = "%04d-%02d-%02d %02d:%02d:%02d" % (
zd.year,
zd.month,