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 9ec0f89 commit 5a276bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sphinx/environment/__init__.py
Expand Up @@ -511,13 +511,17 @@ def get_outdated_files(self, config_changed: bool) -> tuple[set[str], set[str],
break
depmtime = _last_modified_time(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 5a276bd

Please sign in to comment.