Skip to content

Commit

Permalink
FIX: Tolerate huge year
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Aug 9, 2023
1 parent 0699f46 commit 2d2b583
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sphinx/environment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,13 +504,17 @@ def get_outdated_files(self, config_changed: bool) -> tuple[set[str], set[str],
break
depmtime = path.getmtime(deppath)
if depmtime > mtime:
try:
depmtime_dt = datetime.utcfromtimestamp(depmtime)
except ValueError: # e.g., year 53606865 is out of range
depmtime_dt = depmtime
logger.debug(
'[build target] outdated %r '
'from dependency %r: %s -> %s',
docname,
deppath,
datetime.utcfromtimestamp(mtime),
datetime.utcfromtimestamp(depmtime))
depmtime_dt)
changed.add(docname)
break
except OSError:
Expand Down

0 comments on commit 2d2b583

Please sign in to comment.