Fix for issue #1788: Connection objects don't check for existence of attributes in __repr__