{"action":"created","issue":{"url":"https://api.github.com/repos/PyFilesystem/pyfilesystem2/issues/104","repository_url":"https://api.github.com/repos/PyFilesystem/pyfilesystem2","labels_url":"https://api.github.com/repos/PyFilesystem/pyfilesystem2/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/PyFilesystem/pyfilesystem2/issues/104/comments","events_url":"https://api.github.com/repos/PyFilesystem/pyfilesystem2/issues/104/events","html_url":"https://github.com/PyFilesystem/pyfilesystem2/issues/104","id":272940695,"number":104,"title":"Weird UnboundLocalError with fs 2.0.15","user":{"login":"zopyx","id":594239,"avatar_url":"https://avatars0.githubusercontent.com/u/594239?v=4","gravatar_id":"","url":"https://api.github.com/users/zopyx","html_url":"https://github.com/zopyx","followers_url":"https://api.github.com/users/zopyx/followers","following_url":"https://api.github.com/users/zopyx/following{/other_user}","gists_url":"https://api.github.com/users/zopyx/gists{/gist_id}","starred_url":"https://api.github.com/users/zopyx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zopyx/subscriptions","organizations_url":"https://api.github.com/users/zopyx/orgs","repos_url":"https://api.github.com/users/zopyx/repos","events_url":"https://api.github.com/users/zopyx/events{/privacy}","received_events_url":"https://api.github.com/users/zopyx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-10T13:58:40Z","updated_at":"2017-11-10T14:00:07Z","closed_at":null,"author_association":"NONE","body":"I have this weird UnboundLocalError with`fs.opener.open`:\r\n\r\n```\r\n-> result = fs.opener.open('zip://{}'.format(fn), writeable=False)\r\n(Pdb) c\r\n2017-11-10 14:56:17 ERROR Zope.SiteErrorLog 1510322177.580.315878516717 http://dev.zopyx.de:12020/Plone/test-document/current-publish\r\nTraceback (innermost last):\r\n  Module ZPublisher.Publish, line 138, in publish\r\n  Module ZPublisher.mapply, line 77, in mapply\r\n  Module ZPublisher.Publish, line 48, in call_object\r\n  Module zopyx.plone.smashdocs.browser.versioneddocument, line 209, in current_publish\r\nUnboundLocalError: local variable 'fs' referenced before assignment\r\n```\r\n\r\nHowever `fs` is available in exactly the same place:\r\n\r\n```\r\n(Pdb) print fs\r\n<module 'fs' from '/home/ajung/.buildout/eggs/fs-2.0.15-py2.7.egg/fs/__init__.pyc'>\r\n(Pdb) print fs.opener\r\n<module 'fs.opener' from '/home/ajung/.buildout/eggs/fs-2.0.15-py2.7.egg/fs/opener/__init__.pyc'>\r\n(Pdb) print fs.opener.open\r\n<bound method Registry.open of <fs-registry ['ftp', 'osfs', 'usercache', 'temp', 'tar', 'userdata', 'mem', 'sitedata', 'file', 'userconf', 'userlog', 'zip', 'siteconf']>>\r\n\r\n```\r\n\r\nbased on these imports:\r\n\r\n```\r\nimport fs.path\r\nimport fs.opener\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/PyFilesystem/pyfilesystem2/issues/comments/343480488","html_url":"https://github.com/PyFilesystem/pyfilesystem2/issues/104#issuecomment-343480488","issue_url":"https://api.github.com/repos/PyFilesystem/pyfilesystem2/issues/104","id":343480488,"user":{"login":"zopyx","id":594239,"avatar_url":"https://avatars0.githubusercontent.com/u/594239?v=4","gravatar_id":"","url":"https://api.github.com/users/zopyx","html_url":"https://github.com/zopyx","followers_url":"https://api.github.com/users/zopyx/followers","following_url":"https://api.github.com/users/zopyx/following{/other_user}","gists_url":"https://api.github.com/users/zopyx/gists{/gist_id}","starred_url":"https://api.github.com/users/zopyx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zopyx/subscriptions","organizations_url":"https://api.github.com/users/zopyx/orgs","repos_url":"https://api.github.com/users/zopyx/repos","events_url":"https://api.github.com/users/zopyx/events{/privacy}","received_events_url":"https://api.github.com/users/zopyx/received_events","type":"User","site_admin":false},"created_at":"2017-11-10T14:00:07Z","updated_at":"2017-11-10T14:00:07Z","author_association":"NONE","body":"My workaround is to use\r\n\r\n```\r\nimport fs.opener as fs_opener\r\n```\r\nand then\r\n\r\n```\r\nresult = fs_opener.open(...)\r\n```"}}
{"actor":{"display_login":"zopyx"}}