Skip to content
This repository was archived by the owner on Jun 11, 2019. It is now read-only.

Commit 2d81dbd

Browse files
committed
Remove wrong symlink check
Currently the code attempts to check whether the target of a symlink exists, and does not extract the symlink if the target is deemed not to exist. However, the check (`os.path.exists(os.path.join(target, i.linkname))`) is buggy as it does not include the path of the symlink within target. Even if this were fixed, the check would not be able to handle chains of symlinks that happened to be iterated in the wrong order. For now, remove the check entirely.
1 parent 876e89a commit 2d81dbd

File tree

1 file changed

+2
-1
lines changed
  • sphinxcontrib/versioning

1 file changed

+2
-1
lines changed

sphinxcontrib/versioning/git.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ def extract(stdout):
308308
tar.extract(member=info, path=target)
309309
if os.path.splitext(info.name)[1].lower() == '.rst':
310310
mtimes.append(info.name)
311-
for info in (i for i in queued_links if os.path.exists(os.path.join(target, i.linkname))):
311+
for info in queued_links:
312+
# There used to be a check for broken symlinks here, but it was buggy
312313
tar.extract(member=info, path=target)
313314
except tarfile.TarError as exc:
314315
log.debug('Failed to extract output from "git archive" command: %s', str(exc))

0 commit comments

Comments
 (0)