{"action":"closed","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/4202","repository_url":"https://api.github.com/repos/pytest-dev/pytest","labels_url":"https://api.github.com/repos/pytest-dev/pytest/issues/4202/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest/issues/4202/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest/issues/4202/events","html_url":"https://github.com/pytest-dev/pytest/issues/4202","id":371840883,"node_id":"MDU6SXNzdWUzNzE4NDA4ODM=","number":4202,"title":"OS errors because of `py.path` => `pathlib` transition in `tmpdir`.","user":{"login":"WloHu","id":22800245,"node_id":"MDQ6VXNlcjIyODAwMjQ1","avatar_url":"https://avatars1.githubusercontent.com/u/22800245?v=4","gravatar_id":"","url":"https://api.github.com/users/WloHu","html_url":"https://github.com/WloHu","followers_url":"https://api.github.com/users/WloHu/followers","following_url":"https://api.github.com/users/WloHu/following{/other_user}","gists_url":"https://api.github.com/users/WloHu/gists{/gist_id}","starred_url":"https://api.github.com/users/WloHu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WloHu/subscriptions","organizations_url":"https://api.github.com/users/WloHu/orgs","repos_url":"https://api.github.com/users/WloHu/repos","events_url":"https://api.github.com/users/WloHu/events{/privacy}","received_events_url":"https://api.github.com/users/WloHu/received_events","type":"User","site_admin":false},"labels":[{"id":692891970,"node_id":"MDU6TGFiZWw2OTI4OTE5NzA=","url":"https://api.github.com/repos/pytest-dev/pytest/labels/plugin:%20tmpdir","name":"plugin: tmpdir","color":"bfd4f2","default":false},{"id":315571544,"node_id":"MDU6TGFiZWwzMTU1NzE1NDQ=","url":"https://api.github.com/repos/pytest-dev/pytest/labels/type:%20regression","name":"type: regression","color":"f7c6c7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-10-19T07:39:48Z","updated_at":"2018-10-19T12:30:21Z","closed_at":"2018-10-19T12:30:20Z","author_association":"NONE","body":"- [ ] `pip list` of the virtual environment you are using\r\nPython 3.6.5rc1\r\npytest 3.9.1\r\n- [ ] pytest and operating system versions\r\nArchLinux, 4.12.13-1-ARCH\r\nDocker container\r\n\r\n- [ ] Include a detailed description of the bug or suggestion\r\n- [ ] Minimal example if possible\r\n\r\n`pathlib.PosixPath.joinpath` which is used in `_pytest.tmpdir.TempPathFactory.mktemp:44` works differently from previously used `py.path.local.mkdir` in such way that given code:\r\n```python\r\n@pytest.fixture\r\ndef tmp_work_dir(tmpdir_factory):\r\n    return tmpdir_factory.mktemp('/hello', numbered=False)\r\n```\r\nIt 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.\r\nIn Docker container as \"root\" `FileNotFoundError` :\r\n```python\r\n================================================ ERRORS =================================================\r\n________________________________________ ERROR at setup of test _________________________________________\r\n\r\ntmpdir_factory = TempdirFactory(_tmppath_factory=TempPathFactory(_given_basetemp=None, _trace=<pluggy._tracing.TagTracerSub object at 0x7fa093ec9d30>, _basetemp=PosixPath('/tmp/pytest-of-root/pytest-95')))\r\n\r\n    @pytest.fixture\r\n    def tmp_work_dir(tmpdir_factory):\r\n>       return tmpdir_factory.mktemp('/hello', numbered=False)\r\n\r\nsrc/testcases/conftest.py:31: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n/usr/lib/python3.6/pathlib.py:1246: in mkdir\r\n    self._accessor.mkdir(self, mode)\r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n\r\npathobj = PosixPath('/hello')\r\nargs = (511,)\r\n\r\n    @functools.wraps(strfunc)\r\n    def wrapped(pathobj, *args):\r\n>       return strfunc(str(pathobj), *args)\r\nE       FileNotFoundError: [Errno 2] No such file or directory: '/hello'\r\n\r\n/usr/lib/python3.6/pathlib.py:387: FileNotFoundError\r\n```\r\n\r\nIn my OS w/o root privileges `OSError`:\r\n```python\r\n================================================ ERRORS =================================================\r\n________________________________________ ERROR at setup of test _________________________________________\r\n\r\ntmpdir_factory = TempdirFactory(_tmppath_factory=TempPathFactory(_given_basetemp=None, _trace=<pluggy._tracing.TagTracerSub object at 0x7f384edf6a58>, _basetemp=PosixPath('/tmp/pytest-of-user/pytest-2')))\r\n\r\n    @pytest.fixture\r\n    def hi(tmpdir_factory):\r\n        import pdb; pdb.set_trace()\r\n>       return tmpdir_factory.mktemp('/hello')\r\nE       OSError: could not create numbered dir with prefix /hello in /tmp/pytest-of-user/pytest-2 after 10 tries\r\n\r\nsandbox/blahpytest/conftest.py:6: OSError\r\n======================================= 1 error in 18.22 seconds ========================================\r\n```\r\n\r\nWhen run with `sudo` it works in my system however it doesn't help in Docker container.\r\n\r\nNow in such case should it work in the new or old way?"}}
{"actor":{"display_login":"nicoddemus"}}