You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 15, 2024. It is now read-only.
First off, this is really a handy tool, I use it a lot, so thank you for making it easy to retrieve the password for Postgres.
... but, I lost a couple of hours last time at work, because of the behavior of getpass, when no match is found. I had misspelled the url in .pgpass, which then returns None as documented:
Return the password for the specified host, port, dbname and user. None will be returned if a
password can not be found for the specified connection parameters.
Although, I didn't know this was expected behavior. I would have assumed some kind of exception, if the password was not found. I think you should consider throwing an exception instead, because I can't see a situation where returning None would be a useful. You would catch a lot of errors like mine this way, and if you really want None, you can just make a try-except.