pytester: _makefile: use abs=True when joining paths#6578
pytester: _makefile: use abs=True when joining paths#6578blueyed wants to merge 1 commit intopytest-dev:masterfrom
abs=True when joining paths#6578Conversation
Passing in an absolute path should use that, but not join it with the tmpdir.
|
I wonder if we should extend/patch |
| 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.
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.
@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.
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: