{"action":"created","comment":{"url":"https://api.github.com/repos/icgc/icgc-get/pulls/comments/73388762","id":73388762,"diff_hunk":"@@ -186,7 +185,9 @@ def get_manifest(self, manifest, file_ids, api_url, repos, portal):\n \n     def move_files(self, staging, output):\n         for staged_file in os.listdir(staging):\n-            if staged_file != \"state.json\":\n+            if staged_file == \"cidfile\":\n+                os.remove(os.path.join(staging, staged_file))\n+            elif staged_file != \"state.json\":\n                 try:","path":"icgcget/commands/download.py","position":25,"original_position":25,"commit_id":"5d83ba7d0201654bc00fa7b845d670cde9374b2a","original_commit_id":"5d83ba7d0201654bc00fa7b845d670cde9374b2a","user":{"login":"andricDu","id":6350043,"avatar_url":"https://avatars.githubusercontent.com/u/6350043?v=3","gravatar_id":"","url":"https://api.github.com/users/andricDu","html_url":"https://github.com/andricDu","followers_url":"https://api.github.com/users/andricDu/followers","following_url":"https://api.github.com/users/andricDu/following{/other_user}","gists_url":"https://api.github.com/users/andricDu/gists{/gist_id}","starred_url":"https://api.github.com/users/andricDu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andricDu/subscriptions","organizations_url":"https://api.github.com/users/andricDu/orgs","repos_url":"https://api.github.com/users/andricDu/repos","events_url":"https://api.github.com/users/andricDu/events{/privacy}","received_events_url":"https://api.github.com/users/andricDu/received_events","type":"User","site_admin":false},"body":"If I'm understanding this correctly, your outer `try`/`except` block is actually handling errors from the inner `except`.  This forces your eyes to bounce to the end and back up to the top to understand the flow.  Do this instead:\r\n\r\n```python\r\ntry:\r\n    ...\r\nexcept shutil.Error:\r\n    try:\r\n        ....\r\n     except OSError:\r\n        ....\r\n```\r\n\r\nAlso you need to check the OSError error number. If I were to remove the `.staging` file before this ran, it would still throw an OSError complaining about no such file or directory, but your message would indicated it is a permission issue. \r\n\r\nhttps://docs.python.org/2/library/errno.html","created_at":"2016-08-03T18:12:39Z","updated_at":"2016-08-03T18:12:39Z","html_url":"https://github.com/icgc/icgc-get/pull/16#discussion_r73388762","pull_request_url":"https://api.github.com/repos/icgc/icgc-get/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/icgc/icgc-get/pulls/comments/73388762"},"html":{"href":"https://github.com/icgc/icgc-get/pull/16#discussion_r73388762"},"pull_request":{"href":"https://api.github.com/repos/icgc/icgc-get/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/icgc/icgc-get/pulls/16","id":79920373,"html_url":"https://github.com/icgc/icgc-get/pull/16","diff_url":"https://github.com/icgc/icgc-get/pull/16.diff","patch_url":"https://github.com/icgc/icgc-get/pull/16.patch","issue_url":"https://api.github.com/repos/icgc/icgc-get/issues/16","number":16,"state":"open","locked":false,"title":"Intial implmentation of docker and subprocess cleanup methods","user":{"login":"GavinMWilson","id":18145343,"avatar_url":"https://avatars.githubusercontent.com/u/18145343?v=3","gravatar_id":"","url":"https://api.github.com/users/GavinMWilson","html_url":"https://github.com/GavinMWilson","followers_url":"https://api.github.com/users/GavinMWilson/followers","following_url":"https://api.github.com/users/GavinMWilson/following{/other_user}","gists_url":"https://api.github.com/users/GavinMWilson/gists{/gist_id}","starred_url":"https://api.github.com/users/GavinMWilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GavinMWilson/subscriptions","organizations_url":"https://api.github.com/users/GavinMWilson/orgs","repos_url":"https://api.github.com/users/GavinMWilson/repos","events_url":"https://api.github.com/users/GavinMWilson/events{/privacy}","received_events_url":"https://api.github.com/users/GavinMWilson/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-03T14:52:00Z","updated_at":"2016-08-03T18:12:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a3b31f7cdb5d498c6dd1df2f001238b56d51c3f4","assignee":{"login":"andricDu","id":6350043,"avatar_url":"https://avatars.githubusercontent.com/u/6350043?v=3","gravatar_id":"","url":"https://api.github.com/users/andricDu","html_url":"https://github.com/andricDu","followers_url":"https://api.github.com/users/andricDu/followers","following_url":"https://api.github.com/users/andricDu/following{/other_user}","gists_url":"https://api.github.com/users/andricDu/gists{/gist_id}","starred_url":"https://api.github.com/users/andricDu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andricDu/subscriptions","organizations_url":"https://api.github.com/users/andricDu/orgs","repos_url":"https://api.github.com/users/andricDu/repos","events_url":"https://api.github.com/users/andricDu/events{/privacy}","received_events_url":"https://api.github.com/users/andricDu/received_events","type":"User","site_admin":false},"assignees":[{"login":"andricDu","id":6350043,"avatar_url":"https://avatars.githubusercontent.com/u/6350043?v=3","gravatar_id":"","url":"https://api.github.com/users/andricDu","html_url":"https://github.com/andricDu","followers_url":"https://api.github.com/users/andricDu/followers","following_url":"https://api.github.com/users/andricDu/following{/other_user}","gists_url":"https://api.github.com/users/andricDu/gists{/gist_id}","starred_url":"https://api.github.com/users/andricDu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andricDu/subscriptions","organizations_url":"https://api.github.com/users/andricDu/orgs","repos_url":"https://api.github.com/users/andricDu/repos","events_url":"https://api.github.com/users/andricDu/events{/privacy}","received_events_url":"https://api.github.com/users/andricDu/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/icgc/icgc-get/pulls/16/commits","review_comments_url":"https://api.github.com/repos/icgc/icgc-get/pulls/16/comments","review_comment_url":"https://api.github.com/repos/icgc/icgc-get/pulls/comments{/number}","comments_url":"https://api.github.com/repos/icgc/icgc-get/issues/16/comments","statuses_url":"https://api.github.com/repos/icgc/icgc-get/statuses/5d83ba7d0201654bc00fa7b845d670cde9374b2a","head":{"label":"icgc:feature/cleanup","ref":"feature/cleanup","sha":"5d83ba7d0201654bc00fa7b845d670cde9374b2a","user":{"login":"icgc","id":14312020,"avatar_url":"https://avatars.githubusercontent.com/u/14312020?v=3","gravatar_id":"","url":"https://api.github.com/users/icgc","html_url":"https://github.com/icgc","followers_url":"https://api.github.com/users/icgc/followers","following_url":"https://api.github.com/users/icgc/following{/other_user}","gists_url":"https://api.github.com/users/icgc/gists{/gist_id}","starred_url":"https://api.github.com/users/icgc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icgc/subscriptions","organizations_url":"https://api.github.com/users/icgc/orgs","repos_url":"https://api.github.com/users/icgc/repos","events_url":"https://api.github.com/users/icgc/events{/privacy}","received_events_url":"https://api.github.com/users/icgc/received_events","type":"Organization","site_admin":false},"repo":{"id":55261799,"name":"icgc-get","full_name":"icgc/icgc-get","owner":{"login":"icgc","id":14312020,"avatar_url":"https://avatars.githubusercontent.com/u/14312020?v=3","gravatar_id":"","url":"https://api.github.com/users/icgc","html_url":"https://github.com/icgc","followers_url":"https://api.github.com/users/icgc/followers","following_url":"https://api.github.com/users/icgc/following{/other_user}","gists_url":"https://api.github.com/users/icgc/gists{/gist_id}","starred_url":"https://api.github.com/users/icgc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icgc/subscriptions","organizations_url":"https://api.github.com/users/icgc/orgs","repos_url":"https://api.github.com/users/icgc/repos","events_url":"https://api.github.com/users/icgc/events{/privacy}","received_events_url":"https://api.github.com/users/icgc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/icgc/icgc-get","description":"Universal download client for ICGC data residing in various environments","fork":false,"url":"https://api.github.com/repos/icgc/icgc-get","forks_url":"https://api.github.com/repos/icgc/icgc-get/forks","keys_url":"https://api.github.com/repos/icgc/icgc-get/keys{/key_id}","collaborators_url":"https://api.github.com/repos/icgc/icgc-get/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/icgc/icgc-get/teams","hooks_url":"https://api.github.com/repos/icgc/icgc-get/hooks","issue_events_url":"https://api.github.com/repos/icgc/icgc-get/issues/events{/number}","events_url":"https://api.github.com/repos/icgc/icgc-get/events","assignees_url":"https://api.github.com/repos/icgc/icgc-get/assignees{/user}","branches_url":"https://api.github.com/repos/icgc/icgc-get/branches{/branch}","tags_url":"https://api.github.com/repos/icgc/icgc-get/tags","blobs_url":"https://api.github.com/repos/icgc/icgc-get/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/icgc/icgc-get/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/icgc/icgc-get/git/refs{/sha}","trees_url":"https://api.github.com/repos/icgc/icgc-get/git/trees{/sha}","statuses_url":"https://api.github.com/repos/icgc/icgc-get/statuses/{sha}","languages_url":"https://api.github.com/repos/icgc/icgc-get/languages","stargazers_url":"https://api.github.com/repos/icgc/icgc-get/stargazers","contributors_url":"https://api.github.com/repos/icgc/icgc-get/contributors","subscribers_url":"https://api.github.com/repos/icgc/icgc-get/subscribers","subscription_url":"https://api.github.com/repos/icgc/icgc-get/subscription","commits_url":"https://api.github.com/repos/icgc/icgc-get/commits{/sha}","git_commits_url":"https://api.github.com/repos/icgc/icgc-get/git/commits{/sha}","comments_url":"https://api.github.com/repos/icgc/icgc-get/comments{/number}","issue_comment_url":"https://api.github.com/repos/icgc/icgc-get/issues/comments{/number}","contents_url":"https://api.github.com/repos/icgc/icgc-get/contents/{+path}","compare_url":"https://api.github.com/repos/icgc/icgc-get/compare/{base}...{head}","merges_url":"https://api.github.com/repos/icgc/icgc-get/merges","archive_url":"https://api.github.com/repos/icgc/icgc-get/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/icgc/icgc-get/downloads","issues_url":"https://api.github.com/repos/icgc/icgc-get/issues{/number}","pulls_url":"https://api.github.com/repos/icgc/icgc-get/pulls{/number}","milestones_url":"https://api.github.com/repos/icgc/icgc-get/milestones{/number}","notifications_url":"https://api.github.com/repos/icgc/icgc-get/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/icgc/icgc-get/labels{/name}","releases_url":"https://api.github.com/repos/icgc/icgc-get/releases{/id}","deployments_url":"https://api.github.com/repos/icgc/icgc-get/deployments","created_at":"2016-04-01T20:55:06Z","updated_at":"2016-04-25T14:31:06Z","pushed_at":"2016-08-03T14:52:00Z","git_url":"git://github.com/icgc/icgc-get.git","ssh_url":"git@github.com:icgc/icgc-get.git","clone_url":"https://github.com/icgc/icgc-get.git","svn_url":"https://github.com/icgc/icgc-get","homepage":null,"size":476,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"icgc:develop","ref":"develop","sha":"ff661a9c2e4635d58b87168ea946c21b6c14edf9","user":{"login":"icgc","id":14312020,"avatar_url":"https://avatars.githubusercontent.com/u/14312020?v=3","gravatar_id":"","url":"https://api.github.com/users/icgc","html_url":"https://github.com/icgc","followers_url":"https://api.github.com/users/icgc/followers","following_url":"https://api.github.com/users/icgc/following{/other_user}","gists_url":"https://api.github.com/users/icgc/gists{/gist_id}","starred_url":"https://api.github.com/users/icgc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icgc/subscriptions","organizations_url":"https://api.github.com/users/icgc/orgs","repos_url":"https://api.github.com/users/icgc/repos","events_url":"https://api.github.com/users/icgc/events{/privacy}","received_events_url":"https://api.github.com/users/icgc/received_events","type":"Organization","site_admin":false},"repo":{"id":55261799,"name":"icgc-get","full_name":"icgc/icgc-get","owner":{"login":"icgc","id":14312020,"avatar_url":"https://avatars.githubusercontent.com/u/14312020?v=3","gravatar_id":"","url":"https://api.github.com/users/icgc","html_url":"https://github.com/icgc","followers_url":"https://api.github.com/users/icgc/followers","following_url":"https://api.github.com/users/icgc/following{/other_user}","gists_url":"https://api.github.com/users/icgc/gists{/gist_id}","starred_url":"https://api.github.com/users/icgc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icgc/subscriptions","organizations_url":"https://api.github.com/users/icgc/orgs","repos_url":"https://api.github.com/users/icgc/repos","events_url":"https://api.github.com/users/icgc/events{/privacy}","received_events_url":"https://api.github.com/users/icgc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/icgc/icgc-get","description":"Universal download client for ICGC data residing in various environments","fork":false,"url":"https://api.github.com/repos/icgc/icgc-get","forks_url":"https://api.github.com/repos/icgc/icgc-get/forks","keys_url":"https://api.github.com/repos/icgc/icgc-get/keys{/key_id}","collaborators_url":"https://api.github.com/repos/icgc/icgc-get/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/icgc/icgc-get/teams","hooks_url":"https://api.github.com/repos/icgc/icgc-get/hooks","issue_events_url":"https://api.github.com/repos/icgc/icgc-get/issues/events{/number}","events_url":"https://api.github.com/repos/icgc/icgc-get/events","assignees_url":"https://api.github.com/repos/icgc/icgc-get/assignees{/user}","branches_url":"https://api.github.com/repos/icgc/icgc-get/branches{/branch}","tags_url":"https://api.github.com/repos/icgc/icgc-get/tags","blobs_url":"https://api.github.com/repos/icgc/icgc-get/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/icgc/icgc-get/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/icgc/icgc-get/git/refs{/sha}","trees_url":"https://api.github.com/repos/icgc/icgc-get/git/trees{/sha}","statuses_url":"https://api.github.com/repos/icgc/icgc-get/statuses/{sha}","languages_url":"https://api.github.com/repos/icgc/icgc-get/languages","stargazers_url":"https://api.github.com/repos/icgc/icgc-get/stargazers","contributors_url":"https://api.github.com/repos/icgc/icgc-get/contributors","subscribers_url":"https://api.github.com/repos/icgc/icgc-get/subscribers","subscription_url":"https://api.github.com/repos/icgc/icgc-get/subscription","commits_url":"https://api.github.com/repos/icgc/icgc-get/commits{/sha}","git_commits_url":"https://api.github.com/repos/icgc/icgc-get/git/commits{/sha}","comments_url":"https://api.github.com/repos/icgc/icgc-get/comments{/number}","issue_comment_url":"https://api.github.com/repos/icgc/icgc-get/issues/comments{/number}","contents_url":"https://api.github.com/repos/icgc/icgc-get/contents/{+path}","compare_url":"https://api.github.com/repos/icgc/icgc-get/compare/{base}...{head}","merges_url":"https://api.github.com/repos/icgc/icgc-get/merges","archive_url":"https://api.github.com/repos/icgc/icgc-get/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/icgc/icgc-get/downloads","issues_url":"https://api.github.com/repos/icgc/icgc-get/issues{/number}","pulls_url":"https://api.github.com/repos/icgc/icgc-get/pulls{/number}","milestones_url":"https://api.github.com/repos/icgc/icgc-get/milestones{/number}","notifications_url":"https://api.github.com/repos/icgc/icgc-get/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/icgc/icgc-get/labels{/name}","releases_url":"https://api.github.com/repos/icgc/icgc-get/releases{/id}","deployments_url":"https://api.github.com/repos/icgc/icgc-get/deployments","created_at":"2016-04-01T20:55:06Z","updated_at":"2016-04-25T14:31:06Z","pushed_at":"2016-08-03T14:52:00Z","git_url":"git://github.com/icgc/icgc-get.git","ssh_url":"git@github.com:icgc/icgc-get.git","clone_url":"https://github.com/icgc/icgc-get.git","svn_url":"https://github.com/icgc/icgc-get","homepage":null,"size":476,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/icgc/icgc-get/pulls/16"},"html":{"href":"https://github.com/icgc/icgc-get/pull/16"},"issue":{"href":"https://api.github.com/repos/icgc/icgc-get/issues/16"},"comments":{"href":"https://api.github.com/repos/icgc/icgc-get/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/icgc/icgc-get/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/icgc/icgc-get/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/icgc/icgc-get/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/icgc/icgc-get/statuses/5d83ba7d0201654bc00fa7b845d670cde9374b2a"}}}}
{"actor":{"display_login":"andricDu"}}