{"action":"created","comment":{"url":"https://api.github.com/repos/docker/compose/pulls/comments/39320849","id":39320849,"diff_hunk":"@@ -29,16 +28,16 @@ def parallel_execute(objects, obj_callable, msg_index, msg):\n     q = Queue()\n \n     def inner_execute_function(an_callable, parameter, msg_index):\n+        error = None\n         try:\n             result = an_callable(parameter)\n         except APIError as e:\n-            errors[msg_index] = e.explanation\n+            error = e.explanation\n             result = \"error\"\n-        except Exception as e:\n-            errors[msg_index] = e\n+        except Exception as error:\n             result = 'unexpected_exception'\n \n-        q.put((msg_index, result))\n+        q.put((msg_index, result, error))","path":"compose/utils.py","position":25,"original_position":25,"commit_id":"fa603fd20e4573e932b8cff65fafc6b09b052ac0","original_commit_id":"fa603fd20e4573e932b8cff65fafc6b09b052ac0","user":{"login":"dnephin","id":442180,"avatar_url":"https://avatars.githubusercontent.com/u/442180?v=3","gravatar_id":"","url":"https://api.github.com/users/dnephin","html_url":"https://github.com/dnephin","followers_url":"https://api.github.com/users/dnephin/followers","following_url":"https://api.github.com/users/dnephin/following{/other_user}","gists_url":"https://api.github.com/users/dnephin/gists{/gist_id}","starred_url":"https://api.github.com/users/dnephin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnephin/subscriptions","organizations_url":"https://api.github.com/users/dnephin/orgs","repos_url":"https://api.github.com/users/dnephin/repos","events_url":"https://api.github.com/users/dnephin/events{/privacy}","received_events_url":"https://api.github.com/users/dnephin/received_events","type":"User","site_admin":false},"body":"Apparently this breaks in py3 with \r\n\r\n```\r\nUnboundLocalError: local variable 'error' referenced before assignment\r\n```\r\n\r\nIf I change the second except to `except Exception as e: error = e` it succeeds.\r\n\r\nI guess there is something special about using a variable in the exception handler","created_at":"2015-09-11T21:41:07Z","updated_at":"2015-09-11T21:41:07Z","html_url":"https://github.com/docker/compose/pull/2018#discussion_r39320849","pull_request_url":"https://api.github.com/repos/docker/compose/pulls/2018","_links":{"self":{"href":"https://api.github.com/repos/docker/compose/pulls/comments/39320849"},"html":{"href":"https://github.com/docker/compose/pull/2018#discussion_r39320849"},"pull_request":{"href":"https://api.github.com/repos/docker/compose/pulls/2018"}}},"pull_request":{"url":"https://api.github.com/repos/docker/compose/pulls/2018","id":44585502,"html_url":"https://github.com/docker/compose/pull/2018","diff_url":"https://github.com/docker/compose/pull/2018.diff","patch_url":"https://github.com/docker/compose/pull/2018.patch","issue_url":"https://api.github.com/repos/docker/compose/issues/2018","number":2018,"state":"open","locked":false,"title":" Handle unexpected errors, but don't ignore background threads","user":{"login":"dnephin","id":442180,"avatar_url":"https://avatars.githubusercontent.com/u/442180?v=3","gravatar_id":"","url":"https://api.github.com/users/dnephin","html_url":"https://github.com/dnephin","followers_url":"https://api.github.com/users/dnephin/followers","following_url":"https://api.github.com/users/dnephin/following{/other_user}","gists_url":"https://api.github.com/users/dnephin/gists{/gist_id}","starred_url":"https://api.github.com/users/dnephin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnephin/subscriptions","organizations_url":"https://api.github.com/users/dnephin/orgs","repos_url":"https://api.github.com/users/dnephin/repos","events_url":"https://api.github.com/users/dnephin/events{/privacy}","received_events_url":"https://api.github.com/users/dnephin/received_events","type":"User","site_admin":false},"body":"Fixes #1955 \r\n\r\nSee the issue for description of the problem.\r\n\r\nThis does change the behaviour of `parallel_execute()` with unexpected exceptions (prints error instead of raises the exception). In order to handle this properly and still raise an exception a much larger refactor would be necessary (to attempt to join or kill unfinished threads), so I went with this change instead.\r\n\r\nLet me know if you feel it's important to raise the unexpected exception and I can take another pass.","created_at":"2015-09-09T18:44:15Z","updated_at":"2015-09-11T21:41:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9293814658e53bdcee173db10bc805113c7986cf","assignee":null,"milestone":{"url":"https://api.github.com/repos/docker/compose/milestones/9","html_url":"https://github.com/docker/compose/milestones/1.5.0","labels_url":"https://api.github.com/repos/docker/compose/milestones/9/labels","id":1229222,"number":9,"title":"1.5.0","description":"","creator":{"login":"aanand","id":1062,"avatar_url":"https://avatars.githubusercontent.com/u/1062?v=3","gravatar_id":"","url":"https://api.github.com/users/aanand","html_url":"https://github.com/aanand","followers_url":"https://api.github.com/users/aanand/followers","following_url":"https://api.github.com/users/aanand/following{/other_user}","gists_url":"https://api.github.com/users/aanand/gists{/gist_id}","starred_url":"https://api.github.com/users/aanand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aanand/subscriptions","organizations_url":"https://api.github.com/users/aanand/orgs","repos_url":"https://api.github.com/users/aanand/repos","events_url":"https://api.github.com/users/aanand/events{/privacy}","received_events_url":"https://api.github.com/users/aanand/received_events","type":"User","site_admin":false},"open_issues":20,"closed_issues":30,"state":"open","created_at":"2015-07-28T11:48:08Z","updated_at":"2015-09-11T18:27:39Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/docker/compose/pulls/2018/commits","review_comments_url":"https://api.github.com/repos/docker/compose/pulls/2018/comments","review_comment_url":"https://api.github.com/repos/docker/compose/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/compose/issues/2018/comments","statuses_url":"https://api.github.com/repos/docker/compose/statuses/fa603fd20e4573e932b8cff65fafc6b09b052ac0","head":{"label":"dnephin:fix_scale_test","ref":"fix_scale_test","sha":"fa603fd20e4573e932b8cff65fafc6b09b052ac0","user":{"login":"dnephin","id":442180,"avatar_url":"https://avatars.githubusercontent.com/u/442180?v=3","gravatar_id":"","url":"https://api.github.com/users/dnephin","html_url":"https://github.com/dnephin","followers_url":"https://api.github.com/users/dnephin/followers","following_url":"https://api.github.com/users/dnephin/following{/other_user}","gists_url":"https://api.github.com/users/dnephin/gists{/gist_id}","starred_url":"https://api.github.com/users/dnephin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnephin/subscriptions","organizations_url":"https://api.github.com/users/dnephin/orgs","repos_url":"https://api.github.com/users/dnephin/repos","events_url":"https://api.github.com/users/dnephin/events{/privacy}","received_events_url":"https://api.github.com/users/dnephin/received_events","type":"User","site_admin":false},"repo":{"id":21770699,"name":"compose","full_name":"dnephin/compose","owner":{"login":"dnephin","id":442180,"avatar_url":"https://avatars.githubusercontent.com/u/442180?v=3","gravatar_id":"","url":"https://api.github.com/users/dnephin","html_url":"https://github.com/dnephin","followers_url":"https://api.github.com/users/dnephin/followers","following_url":"https://api.github.com/users/dnephin/following{/other_user}","gists_url":"https://api.github.com/users/dnephin/gists{/gist_id}","starred_url":"https://api.github.com/users/dnephin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnephin/subscriptions","organizations_url":"https://api.github.com/users/dnephin/orgs","repos_url":"https://api.github.com/users/dnephin/repos","events_url":"https://api.github.com/users/dnephin/events{/privacy}","received_events_url":"https://api.github.com/users/dnephin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dnephin/compose","description":"A fork","fork":true,"url":"https://api.github.com/repos/dnephin/compose","forks_url":"https://api.github.com/repos/dnephin/compose/forks","keys_url":"https://api.github.com/repos/dnephin/compose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dnephin/compose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dnephin/compose/teams","hooks_url":"https://api.github.com/repos/dnephin/compose/hooks","issue_events_url":"https://api.github.com/repos/dnephin/compose/issues/events{/number}","events_url":"https://api.github.com/repos/dnephin/compose/events","assignees_url":"https://api.github.com/repos/dnephin/compose/assignees{/user}","branches_url":"https://api.github.com/repos/dnephin/compose/branches{/branch}","tags_url":"https://api.github.com/repos/dnephin/compose/tags","blobs_url":"https://api.github.com/repos/dnephin/compose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dnephin/compose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dnephin/compose/git/refs{/sha}","trees_url":"https://api.github.com/repos/dnephin/compose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dnephin/compose/statuses/{sha}","languages_url":"https://api.github.com/repos/dnephin/compose/languages","stargazers_url":"https://api.github.com/repos/dnephin/compose/stargazers","contributors_url":"https://api.github.com/repos/dnephin/compose/contributors","subscribers_url":"https://api.github.com/repos/dnephin/compose/subscribers","subscription_url":"https://api.github.com/repos/dnephin/compose/subscription","commits_url":"https://api.github.com/repos/dnephin/compose/commits{/sha}","git_commits_url":"https://api.github.com/repos/dnephin/compose/git/commits{/sha}","comments_url":"https://api.github.com/repos/dnephin/compose/comments{/number}","issue_comment_url":"https://api.github.com/repos/dnephin/compose/issues/comments{/number}","contents_url":"https://api.github.com/repos/dnephin/compose/contents/{+path}","compare_url":"https://api.github.com/repos/dnephin/compose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dnephin/compose/merges","archive_url":"https://api.github.com/repos/dnephin/compose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dnephin/compose/downloads","issues_url":"https://api.github.com/repos/dnephin/compose/issues{/number}","pulls_url":"https://api.github.com/repos/dnephin/compose/pulls{/number}","milestones_url":"https://api.github.com/repos/dnephin/compose/milestones{/number}","notifications_url":"https://api.github.com/repos/dnephin/compose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dnephin/compose/labels{/name}","releases_url":"https://api.github.com/repos/dnephin/compose/releases{/id}","created_at":"2014-07-12T16:01:06Z","updated_at":"2015-08-03T19:11:32Z","pushed_at":"2015-09-11T18:23:05Z","git_url":"git://github.com/dnephin/compose.git","ssh_url":"git@github.com:dnephin/compose.git","clone_url":"https://github.com/dnephin/compose.git","svn_url":"https://github.com/dnephin/compose","homepage":"","size":3630,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":0,"forks":5,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"b25a300895735b0c15f389331d4a4afca462fecf","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":15045751,"name":"compose","full_name":"docker/compose","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/compose","description":"Define and run multi-container applications with Docker","fork":false,"url":"https://api.github.com/repos/docker/compose","forks_url":"https://api.github.com/repos/docker/compose/forks","keys_url":"https://api.github.com/repos/docker/compose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/compose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/compose/teams","hooks_url":"https://api.github.com/repos/docker/compose/hooks","issue_events_url":"https://api.github.com/repos/docker/compose/issues/events{/number}","events_url":"https://api.github.com/repos/docker/compose/events","assignees_url":"https://api.github.com/repos/docker/compose/assignees{/user}","branches_url":"https://api.github.com/repos/docker/compose/branches{/branch}","tags_url":"https://api.github.com/repos/docker/compose/tags","blobs_url":"https://api.github.com/repos/docker/compose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/compose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/compose/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/compose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/compose/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/compose/languages","stargazers_url":"https://api.github.com/repos/docker/compose/stargazers","contributors_url":"https://api.github.com/repos/docker/compose/contributors","subscribers_url":"https://api.github.com/repos/docker/compose/subscribers","subscription_url":"https://api.github.com/repos/docker/compose/subscription","commits_url":"https://api.github.com/repos/docker/compose/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/compose/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/compose/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/compose/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/compose/contents/{+path}","compare_url":"https://api.github.com/repos/docker/compose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/compose/merges","archive_url":"https://api.github.com/repos/docker/compose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/compose/downloads","issues_url":"https://api.github.com/repos/docker/compose/issues{/number}","pulls_url":"https://api.github.com/repos/docker/compose/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/compose/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/compose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/compose/labels{/name}","releases_url":"https://api.github.com/repos/docker/compose/releases{/id}","created_at":"2013-12-09T11:40:58Z","updated_at":"2015-09-11T11:30:48Z","pushed_at":"2015-09-11T21:08:56Z","git_url":"git://github.com/docker/compose.git","ssh_url":"git@github.com:docker/compose.git","clone_url":"https://github.com/docker/compose.git","svn_url":"https://github.com/docker/compose","homepage":"https://docs.docker.com/compose/","size":72978,"stargazers_count":6258,"watchers_count":6258,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":774,"mirror_url":null,"open_issues_count":430,"forks":774,"open_issues":430,"watchers":6258,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/compose/pulls/2018"},"html":{"href":"https://github.com/docker/compose/pull/2018"},"issue":{"href":"https://api.github.com/repos/docker/compose/issues/2018"},"comments":{"href":"https://api.github.com/repos/docker/compose/issues/2018/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/compose/pulls/2018/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/compose/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/compose/pulls/2018/commits"},"statuses":{"href":"https://api.github.com/repos/docker/compose/statuses/fa603fd20e4573e932b8cff65fafc6b09b052ac0"}}}}