Skip to content

Commit 718993a

Browse files
committed
fix #440 #1008 : coarse timestamp resolution in some filesystem generate wrong outdated file-list
1 parent bee7f8b commit 718993a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

sphinx/environment.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,12 @@ def read(self_):
787787
app.emit('doctree-read', doctree)
788788

789789
# store time of build, for outdated files detection
790-
self.all_docs[docname] = time.time()
790+
# note::
791+
# Some filesystem's have coarse timestamp resolution.
792+
# Therefore time.time() is older than filesystem's timestamp.
793+
# ex. FAT32 have 2sec resolution.
794+
self.all_docs[docname] = max(
795+
time.time(), path.getmtime(self.doc2path(docname)))
791796

792797
if self.versioning_condition:
793798
# get old doctree

0 commit comments

Comments
 (0)