{"action":"created","issue":{"url":"https://api.github.com/repos/SublimeTextIssues/Core/issues/1267","repository_url":"https://api.github.com/repos/SublimeTextIssues/Core","labels_url":"https://api.github.com/repos/SublimeTextIssues/Core/issues/1267/labels{/name}","comments_url":"https://api.github.com/repos/SublimeTextIssues/Core/issues/1267/comments","events_url":"https://api.github.com/repos/SublimeTextIssues/Core/issues/1267/events","html_url":"https://github.com/SublimeTextIssues/Core/issues/1267","id":163906756,"number":1267,"title":"exec.py enchancement","user":{"login":"klonuo","id":361447,"avatar_url":"https://avatars.githubusercontent.com/u/361447?v=3","gravatar_id":"","url":"https://api.github.com/users/klonuo","html_url":"https://github.com/klonuo","followers_url":"https://api.github.com/users/klonuo/followers","following_url":"https://api.github.com/users/klonuo/following{/other_user}","gists_url":"https://api.github.com/users/klonuo/gists{/gist_id}","starred_url":"https://api.github.com/users/klonuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klonuo/subscriptions","organizations_url":"https://api.github.com/users/klonuo/orgs","repos_url":"https://api.github.com/users/klonuo/repos","events_url":"https://api.github.com/users/klonuo/events{/privacy}","received_events_url":"https://api.github.com/users/klonuo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-05T17:44:53Z","updated_at":"2016-07-08T17:28:46Z","closed_at":"2016-07-05T17:49:08Z","body":"Hi,\r\n\r\nwhen using build system's `cmd` property with `shell=True` user needs to pass correctly prepared string, unless he is using Windows.\r\n\r\nFor example:\r\n```json\r\n\"cmd\": [\"gfortran\", \"${file}\", \"-o\", \"${file_base_name}.exe\", \"&&\", \"${file_base_name}.exe\"],\r\n\"shell\": true\r\n```\r\nbehaves as expected on Windows, but on *nix:\r\n```json\r\n\"cmd\": [\"gfortran\", \"${file}\", \"-o\", \"${file_base_name}\", \"&&\", \"./${file_base_name}\"],\r\n\"shell\": true\r\n```\r\nit does not work, as Python expects string when using `shell=True` on *nix.\r\n\r\nUsing command sequence instead escaped string doesn't require user to handle paths, and it seems more comprehensive then escaped string:\r\n\r\n```json\r\ncmd\": \"gfortran \\\"${file}\\\" -o \\\"${file_base_name}\\\" && \\\"./${file_base_name}\\\"\",\r\n```\r\n\r\nSo I'm proposing this patch:\r\n\r\n```diff\r\n--- C:\\temp\\_tc\\exec.py\r\n+++ (clipboard)\r\n@@ -90,6 +90,8 @@\r\n                 shell=False)\r\n         else:\r\n             # Old style build system, just do what it asks\r\n+            if shell and isinstance(cmd, list) and not sys.platform == \"win32\":\r\n+                cmd = subprocess.list2cmdline(cmd).replace('\"', \"'\")\r\n             self.proc = subprocess.Popen(\r\n                 cmd,\r\n                 stdout=subprocess.PIPE,\r\n```"},"comment":{"url":"https://api.github.com/repos/SublimeTextIssues/Core/issues/comments/231421409","html_url":"https://github.com/SublimeTextIssues/Core/issues/1267#issuecomment-231421409","issue_url":"https://api.github.com/repos/SublimeTextIssues/Core/issues/1267","id":231421409,"user":{"login":"klonuo","id":361447,"avatar_url":"https://avatars.githubusercontent.com/u/361447?v=3","gravatar_id":"","url":"https://api.github.com/users/klonuo","html_url":"https://github.com/klonuo","followers_url":"https://api.github.com/users/klonuo/followers","following_url":"https://api.github.com/users/klonuo/following{/other_user}","gists_url":"https://api.github.com/users/klonuo/gists{/gist_id}","starred_url":"https://api.github.com/users/klonuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klonuo/subscriptions","organizations_url":"https://api.github.com/users/klonuo/orgs","repos_url":"https://api.github.com/users/klonuo/repos","events_url":"https://api.github.com/users/klonuo/events{/privacy}","received_events_url":"https://api.github.com/users/klonuo/received_events","type":"User","site_admin":false},"created_at":"2016-07-08T17:28:46Z","updated_at":"2016-07-08T17:28:46Z","body":"Thanks for you comment. I don't believe anything it terrible except human stupidity. \r\n\r\nClosing issues w/o explanation is terrible. No one would bother to report or suggest their useless ideas to arrogant administrators, sure. But it doesn't look like you are the only one... \r\n"}}
{"actor":{"display_login":"klonuo"}}