Skip to content

Commit

Permalink
Allow getpass.getuser() to fail (#687)
Browse files Browse the repository at this point in the history
* Allow getpass.getuser() to fail

Fixes #587

* add changelog entry

Co-authored-by: Richard Schwab <gitrichardschwab-7a2qxq42kj@central-intelligence.agency>
  • Loading branch information
chrisburr and Nothing4You committed Jan 23, 2022
1 parent 9100eab commit 72a8432
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ To be included in 1.0.0 (unreleased)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* Don't send sys.argv[0] as program_name to MySQL server by default #620
* Allow running process as anonymous uid #587


0.0.22 (2021-11-14)
Expand Down
5 changes: 4 additions & 1 deletion aiomysql/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
from .utils import _ConnectionContextManager, _ContextManager
from .log import logger

DEFAULT_USER = getpass.getuser()
try:
DEFAULT_USER = getpass.getuser()
except KeyError:
DEFAULT_USER = "unknown"


def connect(host="localhost", user=None, password="",
Expand Down

0 comments on commit 72a8432

Please sign in to comment.