{"action":"created","issue":{"url":"https://api.github.com/repos/sseemayer/qstat-pretty/issues/11","repository_url":"https://api.github.com/repos/sseemayer/qstat-pretty","labels_url":"https://api.github.com/repos/sseemayer/qstat-pretty/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/sseemayer/qstat-pretty/issues/11/comments","events_url":"https://api.github.com/repos/sseemayer/qstat-pretty/issues/11/events","html_url":"https://github.com/sseemayer/qstat-pretty/issues/11","id":151478457,"number":11,"title":"pstat throws error parsing empty qstat output","user":{"login":"gdevenyi","id":3001850,"avatar_url":"https://avatars.githubusercontent.com/u/3001850?v=3","gravatar_id":"","url":"https://api.github.com/users/gdevenyi","html_url":"https://github.com/gdevenyi","followers_url":"https://api.github.com/users/gdevenyi/followers","following_url":"https://api.github.com/users/gdevenyi/following{/other_user}","gists_url":"https://api.github.com/users/gdevenyi/gists{/gist_id}","starred_url":"https://api.github.com/users/gdevenyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdevenyi/subscriptions","organizations_url":"https://api.github.com/users/gdevenyi/orgs","repos_url":"https://api.github.com/users/gdevenyi/repos","events_url":"https://api.github.com/users/gdevenyi/events{/privacy}","received_events_url":"https://api.github.com/users/gdevenyi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-04-27T20:06:39Z","updated_at":"2016-04-28T15:44:21Z","closed_at":null,"body":"If you have an empty qstat -x, pstat tried to parse it anyways and throws an error.\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"./pstat\", line 139, in <module>\r\n    main()\r\n  File \"./pstat\", line 112, in main\r\n    jobs = parser.parse(source(parser, args))\r\n  File \"/bg01/homescinet/m/mchakrav/gdevenyi/bin/qstat-pretty/qstatpretty/parser/torque.py\", line 58, in parse\r\n    xml = ET.parse(f)\r\n  File \"<string>\", line 45, in parse\r\n  File \"<string>\", line 32, in parse\r\nSyntaxError: no element found: line 1, column 0\r\n```\r\n\r\nNot sure the right place to do this, one would be:\r\nhttps://github.com/sseemayer/qstat-pretty/blob/master/qstatpretty/parser/torque.py#L58\r\nand\r\nhttps://github.com/sseemayer/qstat-pretty/blob/master/qstatpretty/parser/gridengine.py#L51\r\n\r\nNeed to check the length of ``f`` maybe and return no jobs if empty?"},"comment":{"url":"https://api.github.com/repos/sseemayer/qstat-pretty/issues/comments/215472159","html_url":"https://github.com/sseemayer/qstat-pretty/issues/11#issuecomment-215472159","issue_url":"https://api.github.com/repos/sseemayer/qstat-pretty/issues/11","id":215472159,"user":{"login":"muppetjones","id":2041619,"avatar_url":"https://avatars.githubusercontent.com/u/2041619?v=3","gravatar_id":"","url":"https://api.github.com/users/muppetjones","html_url":"https://github.com/muppetjones","followers_url":"https://api.github.com/users/muppetjones/followers","following_url":"https://api.github.com/users/muppetjones/following{/other_user}","gists_url":"https://api.github.com/users/muppetjones/gists{/gist_id}","starred_url":"https://api.github.com/users/muppetjones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muppetjones/subscriptions","organizations_url":"https://api.github.com/users/muppetjones/orgs","repos_url":"https://api.github.com/users/muppetjones/repos","events_url":"https://api.github.com/users/muppetjones/events{/privacy}","received_events_url":"https://api.github.com/users/muppetjones/received_events","type":"User","site_admin":false},"created_at":"2016-04-28T15:44:21Z","updated_at":"2016-04-28T15:44:21Z","body":"Could be. I just checked, and I don't think I've pulled since I added the Torque parser; however, the changes since then don't seem to be part of the problem (at least based on the error from above).\r\n\r\nEither way, thanks for fixing the issue! I'll keep an eye on it and see if I can't get it to trigger on my end."}}