{"action":"created","issue":{"url":"https://api.github.com/repos/clawpack/clawutil/issues/110","repository_url":"https://api.github.com/repos/clawpack/clawutil","labels_url":"https://api.github.com/repos/clawpack/clawutil/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/clawpack/clawutil/issues/110/comments","events_url":"https://api.github.com/repos/clawpack/clawutil/issues/110/events","html_url":"https://github.com/clawpack/clawutil/pull/110","id":196759694,"number":110,"title":"WIP: Use of StringIO in claw_git_status.py","user":{"login":"rjleveque","id":720122,"avatar_url":"https://avatars.githubusercontent.com/u/720122?v=3","gravatar_id":"","url":"https://api.github.com/users/rjleveque","html_url":"https://github.com/rjleveque","followers_url":"https://api.github.com/users/rjleveque/followers","following_url":"https://api.github.com/users/rjleveque/following{/other_user}","gists_url":"https://api.github.com/users/rjleveque/gists{/gist_id}","starred_url":"https://api.github.com/users/rjleveque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjleveque/subscriptions","organizations_url":"https://api.github.com/users/rjleveque/orgs","repos_url":"https://api.github.com/users/rjleveque/repos","events_url":"https://api.github.com/users/rjleveque/events{/privacy}","received_events_url":"https://api.github.com/users/rjleveque/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-12-20T19:33:04Z","updated_at":"2016-12-21T18:31:55Z","closed_at":"2016-12-21T17:52:16Z","pull_request":{"url":"https://api.github.com/repos/clawpack/clawutil/pulls/110","html_url":"https://github.com/clawpack/clawutil/pull/110","diff_url":"https://github.com/clawpack/clawutil/pull/110.diff","patch_url":"https://github.com/clawpack/clawutil/pull/110.patch"},"body":"I think @ketch modified `src/python/clawutil/claw_git_status.py` to change how StringIO is imported from simply\r\n\r\n```\r\nimport StringIO\r\n```\r\n\r\nto:\r\n\r\n```\r\ntry:\r\n    from StringIO import StringIO\r\nexcept ImportError:\r\n    from io import StringIO\r\n```\r\n\r\nI fixed one problem in my commit -- if the first import (in the `try` block) works then `StringIO` is the function, not the module.\r\n\r\nBut there seems to also be a problem if the second import statement is used.  Forcing it to import from `io` gives this error:\r\n\r\n```\r\n  File \"/Users/rjl/git/clawpack/clawutil/src/python/clawutil/claw_git_status.py\", line 77, in repository_status\r\n    output.write(\"\\n\\n===========\\n%s\\n===========\\n\" % repository)\r\nTypeError: unicode argument expected, got 'str'\r\n```\r\neven though the docstring for this function says `Write string to file.`\r\n\r\nWhat was the purpose of this change?"},"comment":{"url":"https://api.github.com/repos/clawpack/clawutil/issues/comments/268602795","html_url":"https://github.com/clawpack/clawutil/pull/110#issuecomment-268602795","issue_url":"https://api.github.com/repos/clawpack/clawutil/issues/110","id":268602795,"user":{"login":"ketch","id":697763,"avatar_url":"https://avatars.githubusercontent.com/u/697763?v=3","gravatar_id":"","url":"https://api.github.com/users/ketch","html_url":"https://github.com/ketch","followers_url":"https://api.github.com/users/ketch/followers","following_url":"https://api.github.com/users/ketch/following{/other_user}","gists_url":"https://api.github.com/users/ketch/gists{/gist_id}","starred_url":"https://api.github.com/users/ketch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketch/subscriptions","organizations_url":"https://api.github.com/users/ketch/orgs","repos_url":"https://api.github.com/users/ketch/repos","events_url":"https://api.github.com/users/ketch/events{/privacy}","received_events_url":"https://api.github.com/users/ketch/received_events","type":"User","site_admin":false},"created_at":"2016-12-21T18:31:54Z","updated_at":"2016-12-21T18:31:54Z","body":"@rjleveque Are you trying to use BytesIO?  I wouldn't use that here; I thought the idea was just to replace the try/except with a version number check (and use StringIO in both cases)."}}
{"actor":{"display_login":"ketch"}}