Skip to content

Commit eea2a76

Browse files
authored
Merge branch '0.9.x' into fix-terminal-width
2 parents e67bf1b + 0efc904 commit eea2a76

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

eyed3/core.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,14 @@ def _validateFormat(s):
372372
pdate, fmt = None, None
373373
for fmt in Date.TIME_STAMP_FORMATS:
374374
try:
375-
pdate = time.strptime(s, fmt)
375+
if "%d" in fmt and "%Y" not in fmt:
376+
# Python 3.15+ no longer allows %d without %Y in strptime
377+
# (see https://github.com/python/cpython/issues/70647).
378+
# Prepend a dummy year to satisfy the requirement; the year
379+
# value is never extracted because "%Y" is not in fmt.
380+
pdate = time.strptime("2000" + s, "%Y" + fmt)
381+
else:
382+
pdate = time.strptime(s, fmt)
376383
break
377384
except ValueError:
378385
# date string did not match format.

0 commit comments

Comments
 (0)