[LyX/2.3.x] Fix bug #11750.

Richard Kimberly Heck rikiheck at lyx.org
Mon Feb 24 23:51:04 UTC 2020


commit fb9bc1a3f71a600ccf7f44164eef470ae79e7479
Author: Richard Kimberly Heck <rikiheck at lyx.org>
Date:   Mon Feb 24 19:00:31 2020 -0500

    Fix bug #11750.
    
    Unfortunately, stat.st_ino returns 0 on Windows, at least on Python 2.7, so we can't use that way of telling when we're seeing the same directory again. Surely the real pathname should work.
    
    (cherry picked from commit 9d8dfe934ba6a73a899c907a687552104d2cb847)
---
 lib/scripts/TeXFiles.py |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/scripts/TeXFiles.py b/lib/scripts/TeXFiles.py
index 188f6b9..16b7df2 100755
--- a/lib/scripts/TeXFiles.py
+++ b/lib/scripts/TeXFiles.py
@@ -121,10 +121,11 @@ for type in types:
             # prevent inifinite recursion
             recurse = []
             for dir in dirs:
-                st = os.stat(os.path.join(root, dir))
-                key = st.st_dev, st.st_ino
-                if key not in visited:
-                    visited.add(key)
+                dirname = os.path.join(root, dir)
+                dirname = os.path.realpath(dirname)
+                dirname = os.path.normcase(dirname)
+                if dirname not in visited:
+                    visited.add(dirname)
                     recurse.append(dir)
             dirs[:] = recurse
             # check file type


More information about the lyx-cvs mailing list