{"action":"created","issue":{"url":"https://api.github.com/repos/pexpect/pexpect/issues/206","labels_url":"https://api.github.com/repos/pexpect/pexpect/issues/206/labels{/name}","comments_url":"https://api.github.com/repos/pexpect/pexpect/issues/206/comments","events_url":"https://api.github.com/repos/pexpect/pexpect/issues/206/events","html_url":"https://github.com/pexpect/pexpect/issues/206","id":69095901,"number":206,"title":"Race condition in pexpect.spawn() on Solaris 11","user":{"login":"reynir","id":348527,"avatar_url":"https://avatars.githubusercontent.com/u/348527?v=3","gravatar_id":"","url":"https://api.github.com/users/reynir","html_url":"https://github.com/reynir","followers_url":"https://api.github.com/users/reynir/followers","following_url":"https://api.github.com/users/reynir/following{/other_user}","gists_url":"https://api.github.com/users/reynir/gists{/gist_id}","starred_url":"https://api.github.com/users/reynir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reynir/subscriptions","organizations_url":"https://api.github.com/users/reynir/orgs","repos_url":"https://api.github.com/users/reynir/repos","events_url":"https://api.github.com/users/reynir/events{/privacy}","received_events_url":"https://api.github.com/users/reynir/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pexpect/pexpect/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/pexpect/pexpect/labels/needs-tests","name":"needs-tests","color":"eb6420"}],"state":"closed","locked":false,"assignee":{"login":"jquast","id":972584,"avatar_url":"https://avatars.githubusercontent.com/u/972584?v=3","gravatar_id":"","url":"https://api.github.com/users/jquast","html_url":"https://github.com/jquast","followers_url":"https://api.github.com/users/jquast/followers","following_url":"https://api.github.com/users/jquast/following{/other_user}","gists_url":"https://api.github.com/users/jquast/gists{/gist_id}","starred_url":"https://api.github.com/users/jquast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jquast/subscriptions","organizations_url":"https://api.github.com/users/jquast/orgs","repos_url":"https://api.github.com/users/jquast/repos","events_url":"https://api.github.com/users/jquast/events{/privacy}","received_events_url":"https://api.github.com/users/jquast/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-04-17T08:38:54Z","updated_at":"2015-09-21T01:29:41Z","closed_at":"2015-09-21T01:29:41Z","body":"It seems it is possible in certain situations for the `child_fd` to be closed before the windowsize can be set. I tried putting in a print before, and the file descriptor looks OK (i.e. it's not -1).\r\n ```python\r\nimport pexpect\r\npexpect.spawn(\"/bin/true\")\r\n```\r\n\r\nRelevant stack trace:\r\n\r\n    Traceback (most recent call last):\r\n      File \"<stdin>\", line 1, in <module>\r\n      File \"/export/home/rbj/.local/lib/python2.6/site-packages/pexpect/__init__.py\", line 511, in __init__\r\n        self._spawn(command, args)\r\n      File \"/export/home/rbj/.local/lib/python2.6/site-packages/pexpect/__init__.py\", line 674, in _spawn\r\n        self.setwinsize(24, 80)\r\n      File \"/export/home/rbj/.local/lib/python2.6/site-packages/pexpect/__init__.py\", line 1602, in setwinsize\r\n        fcntl.ioctl(self.fileno(), TIOCSWINSZ, s)\r\n    IOError: [Errno 6] No such device or address\r\n\r\nThis is a corner case that probably doesn't affect many users (if any). You can download a [Solaris 11.2 VirtualBox image](http://www.oracle.com/technetwork/server-storage/solaris11/downloads/vm-templates-2245495.html) if you want to test it yourself. I have the CPU throttled to 50% on my VM - that might make the race condition more obvious."},"comment":{"url":"https://api.github.com/repos/pexpect/pexpect/issues/comments/141853141","html_url":"https://github.com/pexpect/pexpect/issues/206#issuecomment-141853141","issue_url":"https://api.github.com/repos/pexpect/pexpect/issues/206","id":141853141,"user":{"login":"jquast","id":972584,"avatar_url":"https://avatars.githubusercontent.com/u/972584?v=3","gravatar_id":"","url":"https://api.github.com/users/jquast","html_url":"https://github.com/jquast","followers_url":"https://api.github.com/users/jquast/followers","following_url":"https://api.github.com/users/jquast/following{/other_user}","gists_url":"https://api.github.com/users/jquast/gists{/gist_id}","starred_url":"https://api.github.com/users/jquast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jquast/subscriptions","organizations_url":"https://api.github.com/users/jquast/orgs","repos_url":"https://api.github.com/users/jquast/repos","events_url":"https://api.github.com/users/jquast/events{/privacy}","received_events_url":"https://api.github.com/users/jquast/received_events","type":"User","site_admin":false},"created_at":"2015-09-21T01:29:41Z","updated_at":"2015-09-21T01:29:41Z","body":"Closed 2015-05-20 by release of ptyprocess 0.5, please open new issue if reproducing."}}