{"action":"created","issue":{"url":"https://api.github.com/repos/TimKam/sphinx-pretty-searchresults/issues/27","repository_url":"https://api.github.com/repos/TimKam/sphinx-pretty-searchresults","labels_url":"https://api.github.com/repos/TimKam/sphinx-pretty-searchresults/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/TimKam/sphinx-pretty-searchresults/issues/27/comments","events_url":"https://api.github.com/repos/TimKam/sphinx-pretty-searchresults/issues/27/events","html_url":"https://github.com/TimKam/sphinx-pretty-searchresults/issues/27","id":325802043,"number":27,"title":"UnboundLocalError","user":{"login":"timhoffm","id":2836374,"avatar_url":"https://avatars1.githubusercontent.com/u/2836374?v=4","gravatar_id":"","url":"https://api.github.com/users/timhoffm","html_url":"https://github.com/timhoffm","followers_url":"https://api.github.com/users/timhoffm/followers","following_url":"https://api.github.com/users/timhoffm/following{/other_user}","gists_url":"https://api.github.com/users/timhoffm/gists{/gist_id}","starred_url":"https://api.github.com/users/timhoffm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timhoffm/subscriptions","organizations_url":"https://api.github.com/users/timhoffm/orgs","repos_url":"https://api.github.com/users/timhoffm/repos","events_url":"https://api.github.com/users/timhoffm/events{/privacy}","received_events_url":"https://api.github.com/users/timhoffm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-23T17:24:54Z","updated_at":"2018-05-27T12:40:12Z","closed_at":null,"author_association":"NONE","body":"Version 0.3.5\r\n\r\n~~~\r\nException occurred:\r\n  File \"/home/tim/miniconda3/envs/mpl/lib/python3.6/site-packages/sphinxprettysearchresults/__init__.py\", line 61, in clean_txts\r\n    os.rename(os.path.join(root, file), os.path.join(root, file.replace('.txt', source_suffix + '.txt')))\r\nUnboundLocalError: local variable 'source_suffix' referenced before assignment\r\n~~~\r\n\r\nThere's some logic error here. `source_suffix` is not set if not `file.endswith('.txt')`. Not sure if there has to be an alternate default or if the rename shouldn't take place in that case.\r\n\r\nAlso the `file.replace('.txt')` are a bit dangerous in case that substring is present somewhere within the filename."},"comment":{"url":"https://api.github.com/repos/TimKam/sphinx-pretty-searchresults/issues/comments/392328217","html_url":"https://github.com/TimKam/sphinx-pretty-searchresults/issues/27#issuecomment-392328217","issue_url":"https://api.github.com/repos/TimKam/sphinx-pretty-searchresults/issues/27","id":392328217,"user":{"login":"TimKam","id":5434565,"avatar_url":"https://avatars2.githubusercontent.com/u/5434565?v=4","gravatar_id":"","url":"https://api.github.com/users/TimKam","html_url":"https://github.com/TimKam","followers_url":"https://api.github.com/users/TimKam/followers","following_url":"https://api.github.com/users/TimKam/following{/other_user}","gists_url":"https://api.github.com/users/TimKam/gists{/gist_id}","starred_url":"https://api.github.com/users/TimKam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimKam/subscriptions","organizations_url":"https://api.github.com/users/TimKam/orgs","repos_url":"https://api.github.com/users/TimKam/repos","events_url":"https://api.github.com/users/TimKam/events{/privacy}","received_events_url":"https://api.github.com/users/TimKam/received_events","type":"User","site_admin":false},"created_at":"2018-05-27T12:40:12Z","updated_at":"2018-05-27T12:40:12Z","author_association":"OWNER","body":"Ok. The setup of the matplotlib docs is not really straight-forward, so it might take me some time to isolate the issue. But you could install from this branch: https://github.com/TimKam/sphinx-pretty-searchresults/tree/27-fix-unboundlocalerror.\r\nDoes this fix your issue?"}}
{"actor":{"display_login":"TimKam"}}