{"action":"created","issue":{"url":"https://api.github.com/repos/isbg/isbg/issues/104","repository_url":"https://api.github.com/repos/isbg/isbg","labels_url":"https://api.github.com/repos/isbg/isbg/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/isbg/isbg/issues/104/comments","events_url":"https://api.github.com/repos/isbg/isbg/issues/104/events","html_url":"https://github.com/isbg/isbg/issues/104","id":379225187,"node_id":"MDU6SXNzdWUzNzkyMjUxODc=","number":104,"title":"UnboundLocalError when using isbg with --teachonly option","user":{"login":"gcarret","id":15639238,"node_id":"MDQ6VXNlcjE1NjM5MjM4","avatar_url":"https://avatars2.githubusercontent.com/u/15639238?v=4","gravatar_id":"","url":"https://api.github.com/users/gcarret","html_url":"https://github.com/gcarret","followers_url":"https://api.github.com/users/gcarret/followers","following_url":"https://api.github.com/users/gcarret/following{/other_user}","gists_url":"https://api.github.com/users/gcarret/gists{/gist_id}","starred_url":"https://api.github.com/users/gcarret/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gcarret/subscriptions","organizations_url":"https://api.github.com/users/gcarret/orgs","repos_url":"https://api.github.com/users/gcarret/repos","events_url":"https://api.github.com/users/gcarret/events{/privacy}","received_events_url":"https://api.github.com/users/gcarret/received_events","type":"User","site_admin":false},"labels":[{"id":394860780,"node_id":"MDU6TGFiZWwzOTQ4NjA3ODA=","url":"https://api.github.com/repos/isbg/isbg/labels/bug","name":"bug","color":"fbca04","default":true}],"state":"open","locked":false,"assignee":{"login":"baldurmen","id":6070749,"node_id":"MDQ6VXNlcjYwNzA3NDk=","avatar_url":"https://avatars0.githubusercontent.com/u/6070749?v=4","gravatar_id":"","url":"https://api.github.com/users/baldurmen","html_url":"https://github.com/baldurmen","followers_url":"https://api.github.com/users/baldurmen/followers","following_url":"https://api.github.com/users/baldurmen/following{/other_user}","gists_url":"https://api.github.com/users/baldurmen/gists{/gist_id}","starred_url":"https://api.github.com/users/baldurmen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baldurmen/subscriptions","organizations_url":"https://api.github.com/users/baldurmen/orgs","repos_url":"https://api.github.com/users/baldurmen/repos","events_url":"https://api.github.com/users/baldurmen/events{/privacy}","received_events_url":"https://api.github.com/users/baldurmen/received_events","type":"User","site_admin":false},"assignees":[{"login":"baldurmen","id":6070749,"node_id":"MDQ6VXNlcjYwNzA3NDk=","avatar_url":"https://avatars0.githubusercontent.com/u/6070749?v=4","gravatar_id":"","url":"https://api.github.com/users/baldurmen","html_url":"https://github.com/baldurmen","followers_url":"https://api.github.com/users/baldurmen/followers","following_url":"https://api.github.com/users/baldurmen/following{/other_user}","gists_url":"https://api.github.com/users/baldurmen/gists{/gist_id}","starred_url":"https://api.github.com/users/baldurmen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baldurmen/subscriptions","organizations_url":"https://api.github.com/users/baldurmen/orgs","repos_url":"https://api.github.com/users/baldurmen/repos","events_url":"https://api.github.com/users/baldurmen/events{/privacy}","received_events_url":"https://api.github.com/users/baldurmen/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2018-11-09T16:14:30Z","updated_at":"2018-11-21T23:16:28Z","closed_at":null,"author_association":"NONE","body":"Hi, and thank you for this very useful piece of software.\r\n\r\nI just got this error when trying to train Spamassassin with the --teachonly option.\r\n\r\n```\r\n isbg --imaphost myserver --imapuser mylogin --spaminbox INBOX.Spam --teachonly --learnspambox INBOX.Spam\r\n9 is too big (spamc return code 98)\r\n/home/user/.local/lib/python2.7/site-packages/isbg/imaputils.py:108: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal\r\n  if mail.as_string() in ['', '\\n']:\r\n3 is too big (spamc return code 98)\r\n12/14 spams learned\r\nTraceback (most recent call last):\r\n  File \"/usr/local/bin/isbg\", line 11, in <module>\r\n    load_entry_point('isbg==2.1.3', 'console_scripts', 'isbg')()\r\n  File \"/home/user/.local/lib/python2.7/site-packages/isbg/__main__.py\", line 262, in main\r\n    return sbg.do_isbg()  # return the exit code.\r\n  File \"/home/user/.local/lib/python2.7/site-packages/isbg/isbg.py\", line 600, in do_isbg\r\n    proc = self.do_spamassassin()\r\n  File \"/home/user/.local/lib/python2.7/site-packages/isbg/isbg.py\", line 540, in do_spamassassin\r\n    return proc\r\nUnboundLocalError: local variable 'proc' referenced before assignment\r\n```\r\n(Python 2.7.13 on Debian 9)\r\n\r\nBy looking at the code of isbg.py, the proc variable is defined on line 521, but only in absence of the --teachonly option. \r\n\r\nTherefore the return statement on line 540 fails."},"comment":{"url":"https://api.github.com/repos/isbg/isbg/issues/comments/440845485","html_url":"https://github.com/isbg/isbg/issues/104#issuecomment-440845485","issue_url":"https://api.github.com/repos/isbg/isbg/issues/104","id":440845485,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MDg0NTQ4NQ==","user":{"login":"Cetheus","id":1135608,"node_id":"MDQ6VXNlcjExMzU2MDg=","avatar_url":"https://avatars3.githubusercontent.com/u/1135608?v=4","gravatar_id":"","url":"https://api.github.com/users/Cetheus","html_url":"https://github.com/Cetheus","followers_url":"https://api.github.com/users/Cetheus/followers","following_url":"https://api.github.com/users/Cetheus/following{/other_user}","gists_url":"https://api.github.com/users/Cetheus/gists{/gist_id}","starred_url":"https://api.github.com/users/Cetheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cetheus/subscriptions","organizations_url":"https://api.github.com/users/Cetheus/orgs","repos_url":"https://api.github.com/users/Cetheus/repos","events_url":"https://api.github.com/users/Cetheus/events{/privacy}","received_events_url":"https://api.github.com/users/Cetheus/received_events","type":"User","site_admin":false},"created_at":"2018-11-21T23:16:28Z","updated_at":"2018-11-21T23:16:28Z","author_association":"NONE","body":"Yes, I can confirm to, that it happens. I installed it via pip3:\r\n\r\n```\r\n1821 is too big (spamc return code 98)\r\n1809 is too big (spamc return code 98)\r\n1808 is too big (spamc return code 98)\r\n47/50 spams learned\r\nTraceback (most recent call last):\r\n  File \"./isbg\", line 11, in <module>\r\n    sys.exit(main())\r\n  File \"/home/pi/.local/lib/python3.5/site-packages/isbg/__main__.py\", line 262, in main\r\n    return sbg.do_isbg()  # return the exit code.\r\n  File \"/home/pi/.local/lib/python3.5/site-packages/isbg/isbg.py\", line 600, in do_isbg\r\n    proc = self.do_spamassassin()\r\n  File \"/home/pi/.local/lib/python3.5/site-packages/isbg/isbg.py\", line 540, in do_spamassassin\r\n    return proc\r\nUnboundLocalError: local variable 'proc' referenced before assignment\r\n\r\n\r\npi:~/.local/bin $ ./isbg --version\r\nisbg_v2.1.3, from: /home/pi/.local/lib/python3.5/site-packages/isbg/__main__.py\r\n\r\nLicense GPLv3: GNU GPL version 3 https://gnu.org/licenses/gpl.html\r\n\r\nThis is free software: you are free to change and redistribute it. There is NO\r\nWARRANTY, to the extent permitted by law.\r\n```\r\n"}}
{"actor":{"display_login":"Cetheus"}}