-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
pytester: _makefile: use abs=True
when joining paths
#6578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Passing in an absolute path should use that, but not join it with the tmpdir.
I wonder if we should extend/patch |
@@ -614,7 +614,7 @@ def to_text(s): | |||
|
|||
ret = None | |||
for basename, value in items: | |||
p = self.tmpdir.join(basename).new(ext=ext) | |||
p = self.tmpdir.join(basename, abs=True).new(ext=ext) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a breaking change that opens up badly made test suites to accidentally writing system wide files
the pathlib behaviour is a security nightmare as is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RonnyPfannschmidt
So what changes do you request then actually?
The use case here is using testdir.makepyfile
with an absolute file - do you think this should not be supported then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing the current behavior in #6579.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current behavior fails on Windows:
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\popen-gw1\test_makefile_joins_absolute_path0\C:'
This is a sane method to create a set of files, allowing for absolute paths. Ref: pytest-dev#6578 Ref: pytest-dev#6579
This is a sane method to create a set of files, allowing for absolute paths. Ref: pytest-dev#6578 Ref: pytest-dev#6579
This is a sane method to create a set of files, allowing for absolute paths. Ref: pytest-dev#6578 Ref: pytest-dev#6579
This is a sane method to create a set of files, allowing for absolute paths. Ref: pytest-dev#6578 Ref: pytest-dev#6579
This is a sane method to create a set of files, allowing for absolute paths. Ref: pytest-dev#6578 Ref: pytest-dev#6579
This is a sane method to create a set of files, allowing for absolute paths. Ref: pytest-dev#6578 Ref: pytest-dev#6579
This is a sane method to create a set of files, allowing for absolute paths. Ref: pytest-dev#6578 Ref: pytest-dev#6579
This is a simple, straight-forward method to create a set of files with different extensions, and handling absolute paths (inside of the tmpdir). Ref: pytest-dev#6578 Ref: pytest-dev#6579
This is a simple, straight-forward method to create a set of files with different extensions, and handling absolute paths (inside of the tmpdir). Ref: pytest-dev#6578 Ref: pytest-dev#6579
This is a simple, straight-forward method to create a set of files with different extensions, and handling absolute paths (inside of the tmpdir). Ref: pytest-dev#6578 Ref: pytest-dev#6579
Passing in an absolute path should use that, but not join it with the
tmpdir.
TODO: