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
Don't log the password in the DB URL

Passwords in logs make security teams twitchy.  Fixes #2896.
Merge pull request #1227 from djmitche/bug2540

Replace bare excepts

Fixes ticket:2540
Merge pull request #1228 from djmitche/bug2896

Don't log the password in the DB URL

Fixes ticket:2896
Re-add syntax error in tutorial (thanks to Marco Paolini)