Ensure Bugzilla_token is set when no args present

Thanks to Simon Baird for pointing out the issue.
Fix a pep8 warning
Fix autodetection implementation

Use shallow copy of local symbol table. Using dictionary returned by
locals() will not work as expected in python3.