Skip to content

Commit

Permalink
Don't send sys.argv[0] as program_name to MySQL server by default (#681)
Browse files Browse the repository at this point in the history
fixes #620, closes #621
  • Loading branch information
Nothing4You committed Jan 22, 2022
1 parent c1c2fb5 commit 0a64588
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changes
-------

To be included in 1.0.0 (unreleased)
^^^^^^^^^^^^^^^^^^^

* Don't send sys.argv[0] as program_name to MySQL server by default #620


0.0.22 (2021-11-14)
^^^^^^^^^^^^^^^^^^^

Expand Down
4 changes: 1 addition & 3 deletions aiomysql/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def __init__(self, host="localhost", user=None, password="",
when using IAM authentication with Amazon RDS.
(default: Server Default)
:param program_name: Program name string to provide when
handshaking with MySQL. (default: sys.argv[0])
handshaking with MySQL. (omitted by default)
:param server_public_key: SHA256 authentication plugin public
key value.
:param loop: asyncio loop
Expand Down Expand Up @@ -185,8 +185,6 @@ def __init__(self, host="localhost", user=None, password="",
}
if program_name:
self._connect_attrs["program_name"] = program_name
elif sys.argv:
self._connect_attrs["program_name"] = sys.argv[0]

self._unix_socket = unix_socket
if charset:
Expand Down
4 changes: 3 additions & 1 deletion docs/connection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ Example::
when using IAM authentication with Amazon RDS.
(default: Server Default)
:param program_name: Program name string to provide when
handshaking with MySQL. (default: sys.argv[0])
handshaking with MySQL. (omitted by default)
.. versionchanged:: 1.0
``sys.argv[0]`` is no longer passed by default
:param server_public_key: SHA256 authenticaiton plugin public key value.
:param loop: asyncio event loop instance or ``None`` for default one.
:returns: :class:`Connection` instance.
Expand Down

0 comments on commit 0a64588

Please sign in to comment.