{"action":"created","issue":{"url":"https://api.github.com/repos/pypa/setuptools/issues/702","repository_url":"https://api.github.com/repos/pypa/setuptools","labels_url":"https://api.github.com/repos/pypa/setuptools/issues/702/labels{/name}","comments_url":"https://api.github.com/repos/pypa/setuptools/issues/702/comments","events_url":"https://api.github.com/repos/pypa/setuptools/issues/702/events","html_url":"https://github.com/pypa/setuptools/issues/702","id":168259606,"number":702,"title":"pkg_resources: UnboundLocalError: local variable 'dist' referenced before assignment","user":{"login":"The-Compiler","id":625793,"avatar_url":"https://avatars.githubusercontent.com/u/625793?v=3","gravatar_id":"","url":"https://api.github.com/users/The-Compiler","html_url":"https://github.com/The-Compiler","followers_url":"https://api.github.com/users/The-Compiler/followers","following_url":"https://api.github.com/users/The-Compiler/following{/other_user}","gists_url":"https://api.github.com/users/The-Compiler/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Compiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Compiler/subscriptions","organizations_url":"https://api.github.com/users/The-Compiler/orgs","repos_url":"https://api.github.com/users/The-Compiler/repos","events_url":"https://api.github.com/users/The-Compiler/events{/privacy}","received_events_url":"https://api.github.com/users/The-Compiler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-29T06:31:39Z","updated_at":"2016-07-29T08:10:12Z","closed_at":null,"body":"When trying to run my package's tests frozen via cx_Freeze on Windows, I just got this:\r\n```\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\pkg_resources\\__init__.py\", line 2986, in _initialize_master_working_set\r\n    del dist\r\nUnboundLocalError: local variable 'dist' referenced before assignment\r\n```\r\n\r\nfull traceback:\r\n\r\n```\r\nunittests-frozen runtests: commands[2] | C:\\projects\\qutebrowser\\.tox\\unittests-frozen/build/run-frozen-tests\r\nTraceback (most recent call last):\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\cx_Freeze\\initscripts\\Console.py\", line 27, in <module>\r\n    exec(code, m.__dict__)\r\n  File \"scripts/dev/run_frozen_tests.py\", line 38, in <module>\r\n    pytest_rerunfailures, pytest_warnings]))\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\_pytest\\config.py\", line 39, in main\r\n    config = _prepareconfig(args, plugins)\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\_pytest\\config.py\", line 118, in _prepareconfig\r\n    pluginmanager=pluginmanager, args=args)\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\_pytest\\vendored_packages\\pluggy.py\", line 724, in __call__\r\n    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\_pytest\\vendored_packages\\pluggy.py\", line 338, in _hookexec\r\n    return self._inner_hookexec(hook, methods, kwargs)\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\_pytest\\vendored_packages\\pluggy.py\", line 333, in <lambda>\r\n    _MultiCall(methods, kwargs, hook.spec_opts).execute()\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\_pytest\\vendored_packages\\pluggy.py\", line 595, in execute\r\n    return _wrapped_call(hook_impl.function(*args), self.execute)\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\_pytest\\vendored_packages\\pluggy.py\", line 249, in _wrapped_call\r\n    wrap_controller.send(call_outcome)\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\_pytest\\helpconfig.py\", line 28, in pytest_cmdline_parse\r\n    config = outcome.get_result()\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\_pytest\\vendored_packages\\pluggy.py\", line 278, in get_result\r\n    raise ex[1].with_traceback(ex[2])\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\_pytest\\vendored_packages\\pluggy.py\", line 264, in __init__\r\n    self.result = func()\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\_pytest\\vendored_packages\\pluggy.py\", line 596, in execute\r\n    res = hook_impl.function(*args)\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\_pytest\\config.py\", line 861, in pytest_cmdline_parse\r\n    self.parse(args)\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\_pytest\\config.py\", line 966, in parse\r\n    self._preparse(args, addopts=addopts)\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\_pytest\\config.py\", line 927, in _preparse\r\n    self.pluginmanager.load_setuptools_entrypoints(\"pytest11\")\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\_pytest\\vendored_packages\\pluggy.py\", line 495, in load_setuptools_entrypoints\r\n    from pkg_resources import iter_entry_points, DistributionNotFound\r\n  File \"c:\\python\\32-bit\\3.4\\lib\\importlib\\_bootstrap.py\", line 2237, in _find_and_load\r\n  File \"c:\\python\\32-bit\\3.4\\lib\\importlib\\_bootstrap.py\", line 2226, in _find_and_load_unlocked\r\n  File \"c:\\python\\32-bit\\3.4\\lib\\importlib\\_bootstrap.py\", line 1191, in _load_unlocked\r\n  File \"c:\\python\\32-bit\\3.4\\lib\\importlib\\_bootstrap.py\", line 1161, in _load_backward_compatible\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\pkg_resources\\__init__.py\", line 2958, in <module>\r\n    @_call_aside\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\pkg_resources\\__init__.py\", line 2944, in _call_aside\r\n    f(*args, **kwargs)\r\n  File \"C:\\projects\\qutebrowser\\.tox\\unittests-frozen\\lib\\site-packages\\pkg_resources\\__init__.py\", line 2986, in _initialize_master_working_set\r\n    del dist\r\nUnboundLocalError: local variable 'dist' referenced before assignment\r\n```\r\n\r\nThis seems to be introduced in #698 (cc @minrk) and happens when the `for dist in working_set:` above doesn't assign to `dist` because `working_set` is empty."},"comment":{"url":"https://api.github.com/repos/pypa/setuptools/issues/comments/236120638","html_url":"https://github.com/pypa/setuptools/issues/702#issuecomment-236120638","issue_url":"https://api.github.com/repos/pypa/setuptools/issues/702","id":236120638,"user":{"login":"minrk","id":151929,"avatar_url":"https://avatars.githubusercontent.com/u/151929?v=3","gravatar_id":"","url":"https://api.github.com/users/minrk","html_url":"https://github.com/minrk","followers_url":"https://api.github.com/users/minrk/followers","following_url":"https://api.github.com/users/minrk/following{/other_user}","gists_url":"https://api.github.com/users/minrk/gists{/gist_id}","starred_url":"https://api.github.com/users/minrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minrk/subscriptions","organizations_url":"https://api.github.com/users/minrk/orgs","repos_url":"https://api.github.com/users/minrk/repos","events_url":"https://api.github.com/users/minrk/events{/privacy}","received_events_url":"https://api.github.com/users/minrk/received_events","type":"User","site_admin":false},"created_at":"2016-07-29T08:10:12Z","updated_at":"2016-07-29T08:10:12Z","body":"Fixed by #703. Sorry about that, and thanks for catching it!"}}
{"actor":{"display_login":"minrk"}}