-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
OS errors because of py.path
=> pathlib
transition in tmpdir
.
#4202
Comments
Thanks @WloHu for the report. |
tbh, the old code looks like a bug and the new code looks fixed. I would expect |
we should fail flat if an absolute path is passed, the old code just accepted it and i have no idea off hand what id did (one of the reasons why i want to get away from |
Perhaps we should just close this as working as intended then? I agree it seems like the original intent was to write @WloHu what do you think? |
@RonnyPfannschmidt answered my question that "we should fail flat if an absolute path is passed". So it means that old behaviour wasn't valid. @nicoddemus It seems like it can be closed but is it ok for |
@WloHu I don't think we should support this out of the box because of the potential for misuse, so IMHO the current failing behavior is fine. I personally don't think it is necessary, but @RonnyPfannschmidt would you like to open a separate issue to explicitly forbid receiving absolute paths in |
Reopening until ii create aa followup (on my mobile ATM) |
We should also reject relative paths where the destination is outside the tempdir - e.g. |
@RonnyPfannschmidt do you think this is still relevant. |
Yes |
Sorry, I meant this ^ |
closing as the followup was made, thanks for the reminder/pointer, i missed it on mobile |
pip list
of the virtual environment you are usingPython 3.6.5rc1
pytest 3.9.1
pytest and operating system versions
ArchLinux, 4.12.13-1-ARCH
Docker container
Include a detailed description of the bug or suggestion
Minimal example if possible
pathlib.PosixPath.joinpath
which is used in_pytest.tmpdir.TempPathFactory.mktemp:44
works differently from previously usedpy.path.local.mkdir
in such way that given code:It tries to create temporary directory "/hello" instead "/tmp/pytest-of-user/pytest-0/hello" and fails when
pathlib.PosixPath.mkdir()
is run with different errors depending where I run it.In Docker container as "root"
FileNotFoundError
:In my OS w/o root privileges
OSError
:When run with
sudo
it works in my system however it doesn't help in Docker container.Now in such case should it work in the new or old way?
The text was updated successfully, but these errors were encountered: