{"action":"created","issue":{"url":"https://api.github.com/repos/singularityhub/singularity-cli/issues/62","repository_url":"https://api.github.com/repos/singularityhub/singularity-cli","labels_url":"https://api.github.com/repos/singularityhub/singularity-cli/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/singularityhub/singularity-cli/issues/62/comments","events_url":"https://api.github.com/repos/singularityhub/singularity-cli/issues/62/events","html_url":"https://github.com/singularityhub/singularity-cli/issues/62","id":359342055,"node_id":"MDU6SXNzdWUzNTkzNDIwNTU=","number":62,"title":" errors not handled correctly in function [ spython/main/run.py. ] run()","user":{"login":"al3x609","id":4086644,"node_id":"MDQ6VXNlcjQwODY2NDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/4086644?v=4","gravatar_id":"","url":"https://api.github.com/users/al3x609","html_url":"https://github.com/al3x609","followers_url":"https://api.github.com/users/al3x609/followers","following_url":"https://api.github.com/users/al3x609/following{/other_user}","gists_url":"https://api.github.com/users/al3x609/gists{/gist_id}","starred_url":"https://api.github.com/users/al3x609/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/al3x609/subscriptions","organizations_url":"https://api.github.com/users/al3x609/orgs","repos_url":"https://api.github.com/users/al3x609/repos","events_url":"https://api.github.com/users/al3x609/events{/privacy}","received_events_url":"https://api.github.com/users/al3x609/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-12T07:04:03Z","updated_at":"2018-09-12T09:58:17Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"## Expected Behavior\r\n\r\nthe function **run** should not get to execute this error **AttributeError: 'NoneType' object has no attribute 'strip'** in case of previous errors\r\n\r\nlike to:\r\nERROR Return Code -15: ( ... message ...)\r\n\r\n## Actual Behavior\r\nthis a intencional test:\r\nI deploy a container that ends all processes within it after a defined time, with a call to _kill_\r\n\r\nthe first error `ERROR Return Code -15` is correct because `subprocess.Popen.returncode` return -15 with the Unix signal SIGTERM=-15, sent by a call to kill;  \r\n\r\nbut I should not get to evaluate the sentence [result = result.strip('\\n')](https://github.com/al3x609/singularity-cli/blob/20f820bc037206a3bf090043c578bdb29a7deaa2/spython/main/run.py#L94)\r\n\r\ndue to the error caught in the previous step\r\n\r\n## Steps to Reproduce\r\n\r\n-  start any container indefinitely\r\n-  kill the principal process inside de container in another terminal.\r\n- check the output in the first shell\r\nroute access \r\n`spyton.main.run.__init.__py._run_command -> Client._run_command  -> command.run_command -> run_cmd(utils.terminal.run_command )` => [subprocess.communicate()](https://github.com/al3x609/singularity-cli/blob/20f820bc037206a3bf090043c578bdb29a7deaa2/spython/utils/terminal.py#L134)\r\n## Context\r\n* Operating System: centos 7 64 bits\r\n* singularity version: latest\r\n* spython version: latest\r\n* python version: 3.7\r\n\r\n## Failure Logs\r\n\r\n![image](https://user-images.githubusercontent.com/4086644/45405869-27f43e80-b62a-11e8-9f5f-055b2e805680.png)\r\n\r\n\r\n\r\n## Possible Fix\r\nbefore\r\n````\r\n    result = result['mesaje'].strip('\\n')\r\n````\r\nafter\r\n```\r\n    if(result):\r\n        result = result['mesaje'].strip('\\n')\r\n```\r\n![image](https://user-images.githubusercontent.com/4086644/45407194-4e1bdd80-b62e-11e8-8ce1-04a82b95b134.png)\r\n"},"comment":{"url":"https://api.github.com/repos/singularityhub/singularity-cli/issues/comments/420587480","html_url":"https://github.com/singularityhub/singularity-cli/issues/62#issuecomment-420587480","issue_url":"https://api.github.com/repos/singularityhub/singularity-cli/issues/62","id":420587480,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDU4NzQ4MA==","user":{"login":"vsoch","id":814322,"node_id":"MDQ6VXNlcjgxNDMyMg==","avatar_url":"https://avatars0.githubusercontent.com/u/814322?v=4","gravatar_id":"","url":"https://api.github.com/users/vsoch","html_url":"https://github.com/vsoch","followers_url":"https://api.github.com/users/vsoch/followers","following_url":"https://api.github.com/users/vsoch/following{/other_user}","gists_url":"https://api.github.com/users/vsoch/gists{/gist_id}","starred_url":"https://api.github.com/users/vsoch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsoch/subscriptions","organizations_url":"https://api.github.com/users/vsoch/orgs","repos_url":"https://api.github.com/users/vsoch/repos","events_url":"https://api.github.com/users/vsoch/events{/privacy}","received_events_url":"https://api.github.com/users/vsoch/received_events","type":"User","site_admin":false},"created_at":"2018-09-12T09:58:17Z","updated_at":"2018-09-12T09:58:17Z","author_association":"MEMBER","body":"Agreed! Can you give me a dummy case to test this (and check the fix is sufficient?)"}}
{"actor":{"display_login":"vsoch"}}