summaryrefslogtreecommitdiff
path: root/src/tox/config
diff options
context:
space:
mode:
authorBernát Gábor <gaborjbernat@gmail.com>2022-12-03 19:16:56 -0800
committerGitHub <noreply@github.com>2022-12-03 19:16:56 -0800
commit932bb3e608694bee0017846b5e3f9856667ce476 (patch)
treea3d8248a072e876d82883bf4d2c23b333a4567be /src/tox/config
parentf4b43b589bc3f1ee612224156cf027c7b6d6d6d3 (diff)
downloadtox-git-932bb3e608694bee0017846b5e3f9856667ce476.tar.gz
Ensure paths constructed by tox stay meaningful (#2587)
Resolves https://github.com/tox-dev/tox/issues/2562
Diffstat (limited to 'src/tox/config')
-rw-r--r--src/tox/config/main.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tox/config/main.py b/src/tox/config/main.py
index d122d598..38efb600 100644
--- a/src/tox/config/main.py
+++ b/src/tox/config/main.py
@@ -29,7 +29,6 @@ class Config:
pos_args: Sequence[str] | None,
work_dir: Path,
) -> None:
-
self._pos_args = None if pos_args is None else tuple(pos_args)
self._work_dir = work_dir
self._root = root
@@ -93,6 +92,9 @@ class Config:
# work dir is where we put our own files
root: Path = source.path.parent if parsed.root_dir is None else parsed.root_dir
work_dir: Path = source.path.parent if parsed.work_dir is None else parsed.work_dir
+ # if these are relative we need to expand them them to ensure paths built on this can resolve independent on cwd
+ root = root.resolve()
+ work_dir = work_dir.resolve()
return cls(
config_source=source,
options=parsed,