Replace bare excepts with something more responsible

In many cases, this is 'except Exception', but where a more specifc
exception was obvious, that is used instead.
have pylint check for bare except's

Fixes #2540.
fix minor errors
pep8 spacing on files that haven't been touched in a while
Merge pull request #1227 from djmitche/bug2540

Replace bare excepts

Fixes ticket:2540