{"action":"created","issue":{"url":"https://api.github.com/repos/pelson/conda-execute/issues/5","labels_url":"https://api.github.com/repos/pelson/conda-execute/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/pelson/conda-execute/issues/5/comments","events_url":"https://api.github.com/repos/pelson/conda-execute/issues/5/events","html_url":"https://github.com/pelson/conda-execute/issues/5","id":111971209,"number":5,"title":"`check_call` ignores `PATH` on windows","user":{"login":"faph","id":8397805,"avatar_url":"https://avatars.githubusercontent.com/u/8397805?v=3","gravatar_id":"","url":"https://api.github.com/users/faph","html_url":"https://github.com/faph","followers_url":"https://api.github.com/users/faph/followers","following_url":"https://api.github.com/users/faph/following{/other_user}","gists_url":"https://api.github.com/users/faph/gists{/gist_id}","starred_url":"https://api.github.com/users/faph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faph/subscriptions","organizations_url":"https://api.github.com/users/faph/orgs","repos_url":"https://api.github.com/users/faph/repos","events_url":"https://api.github.com/users/faph/events{/privacy}","received_events_url":"https://api.github.com/users/faph/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-17T16:20:03Z","updated_at":"2015-10-19T20:31:48Z","closed_at":null,"body":"On windows you have to run the command execution through shell to actually use the `PATH` environment variable like this: `subprocess.check_call(cmd, env=environ, shell=True)`\r\n\r\nSee also: http://stackoverflow.com/a/5659249/3210363\r\n\r\nNot sure if you would want to run it through shell on all platforms or just windows due to the path issue."},"comment":{"url":"https://api.github.com/repos/pelson/conda-execute/issues/comments/149338150","html_url":"https://github.com/pelson/conda-execute/issues/5#issuecomment-149338150","issue_url":"https://api.github.com/repos/pelson/conda-execute/issues/5","id":149338150,"user":{"login":"faph","id":8397805,"avatar_url":"https://avatars.githubusercontent.com/u/8397805?v=3","gravatar_id":"","url":"https://api.github.com/users/faph","html_url":"https://github.com/faph","followers_url":"https://api.github.com/users/faph/followers","following_url":"https://api.github.com/users/faph/following{/other_user}","gists_url":"https://api.github.com/users/faph/gists{/gist_id}","starred_url":"https://api.github.com/users/faph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faph/subscriptions","organizations_url":"https://api.github.com/users/faph/orgs","repos_url":"https://api.github.com/users/faph/repos","events_url":"https://api.github.com/users/faph/events{/privacy}","received_events_url":"https://api.github.com/users/faph/received_events","type":"User","site_admin":false},"created_at":"2015-10-19T20:31:48Z","updated_at":"2015-10-19T20:31:48Z","body":"I would be worried that the which implementation could become complex if you also have to cover for .exe, .cmd, .bat etc. Plus how do you handle command sequences, eg. `cmd1 && cmd2`?\r\n\r\nRouting through the shell seems the most natural way, at least on Windows. Can we mitigate the security issue by quoting using `shlex.quote()`? See https://docs.python.org/3/library/subprocess.html#security-considerations. I've no experience with that. "}}