Skip to content

Commit

Permalink
Ignore invalid symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
d0ugal committed Jun 27, 2015
1 parent 79d7907 commit a5ab2e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mkdocs/config/config_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,13 @@ def walk_docs_dir(self, docs_dir):
dirs.sort()
for filename in sorted(filenames):
fullpath = os.path.join(dirpath, filename)

# Some editors (namely Emacs) will create temporary symlinks
# for internal magic. We can just ignore these files.
if os.path.islink(fullpath):
if not os.path.exists(os.readlink(filename)):
continue

relpath = os.path.normpath(os.path.relpath(fullpath, docs_dir))
if self.file_match(relpath):
yield relpath
Expand Down
1 change: 1 addition & 0 deletions test

0 comments on commit a5ab2e1

Please sign in to comment.