未验证 提交 2c7debfd 编写于 作者: F Frost Ming

Get the absolute path without resolving the symlinks

Fix #976
上级 1ec1f88a
Don't follow symlinks for the paths in the requirement strings.
......@@ -309,9 +309,9 @@ class FileRequirement(Requirement):
def _parse_url(self) -> None:
if not self.url:
if self.path:
self.url = path_to_url(self.path.resolve().as_posix())
self.url = path_to_url(self.path.absolute().as_posix())
if not self.path.is_absolute():
project_root = Path(".").resolve().as_posix().lstrip("/")
project_root = Path(".").absolute().as_posix().lstrip("/")
self.url = self.url.replace(project_root, "${PROJECT_ROOT}")
else:
try:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册