Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion fs/_ftp_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,15 @@ def parse_line(line):
def _parse_time(t, formats):
for frmt in formats:
try:
_t = time.strptime(t, frmt)
if "%d" in frmt and "%Y" not in frmt:
# Cope with https://github.com/python/cpython/issues/70647
# (deprecated in 3.13, removed in 3.15) by adding a year to
# achieve prior semantics.
_t = time.strptime(
time.strftime("%Y!", time.localtime()) + t, "%Y!" + frmt
)
else:
_t = time.strptime(t, frmt)
break
except ValueError:
continue
Expand Down