aio-libs / aiomysql

aiomysql is a library for accessing a MySQL database from the asyncio
https://aiomysql.rtfd.io
MIT License
1.74k stars 255 forks source link

Fix log exception #862

Closed laozhp closed 1 year ago

laozhp commented 1 year ago

What do these changes do?

Fix log exception, when login mysql using sha256_password_auth, exception throw TypeError: not all arguments converted during string formatting at connection.py:1012

            logger.debug(
                "Received public key:\n",
                self.server_public_key.decode('ascii')
            )

Are there changes in behavior for the user?

No.

Related issue number

Checklist

codecov[bot] commented 1 year ago

Codecov Report

Merging #862 (cf2b838) into master (5877a88) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #862   +/-   ##
=======================================
  Coverage   93.64%   93.64%           
=======================================
  Files          36       36           
  Lines        5542     5542           
  Branches      939      939           
=======================================
  Hits         5190     5190           
  Misses        262      262           
  Partials       90       90           
Flag Coverage Δ
ubuntu-latest_3.10_mariadb-10.3 90.18% <ø> (ø)
ubuntu-latest_3.10_mariadb-10.4 90.18% <ø> (ø)
ubuntu-latest_3.10_mariadb-10.5 90.16% <ø> (ø)
ubuntu-latest_3.10_mariadb-10.6 90.16% <ø> (ø)
ubuntu-latest_3.10_mariadb-10.7 90.16% <ø> (ø)
ubuntu-latest_3.10_mariadb-10.8 90.16% <ø> (ø)
ubuntu-latest_3.10_mysql-5.7 90.86% <ø> (ø)
ubuntu-latest_3.10_mysql-8.0 92.25% <ø> (ø)
ubuntu-latest_3.11-dev_mariadb-10.3 90.14% <ø> (ø)
ubuntu-latest_3.11-dev_mariadb-10.4 90.14% <ø> (ø)
ubuntu-latest_3.11-dev_mariadb-10.5 90.12% <ø> (ø)
ubuntu-latest_3.11-dev_mariadb-10.6 90.12% <ø> (ø)
ubuntu-latest_3.11-dev_mariadb-10.7 90.12% <ø> (ø)
ubuntu-latest_3.11-dev_mariadb-10.8 90.12% <ø> (ø)
ubuntu-latest_3.11-dev_mysql-5.7 90.83% <ø> (ø)
ubuntu-latest_3.11-dev_mysql-8.0 92.22% <ø> (ø)
ubuntu-latest_3.7_mariadb-10.3 89.63% <ø> (ø)
ubuntu-latest_3.7_mariadb-10.4 89.63% <ø> (ø)
ubuntu-latest_3.7_mariadb-10.5 89.61% <ø> (ø)
ubuntu-latest_3.7_mariadb-10.6 89.61% <ø> (ø)
ubuntu-latest_3.7_mariadb-10.7 89.61% <ø> (ø)
ubuntu-latest_3.7_mariadb-10.8 89.61% <ø> (ø)
ubuntu-latest_3.7_mysql-5.7 90.36% <ø> (ø)
ubuntu-latest_3.7_mysql-8.0 91.83% <ø> (ø)
ubuntu-latest_3.8_mariadb-10.3 90.22% <ø> (ø)
ubuntu-latest_3.8_mariadb-10.4 90.22% <ø> (ø)
ubuntu-latest_3.8_mariadb-10.5 90.20% <ø> (ø)
ubuntu-latest_3.8_mariadb-10.6 90.20% <ø> (ø)
ubuntu-latest_3.8_mariadb-10.7 90.20% <ø> (ø)
ubuntu-latest_3.8_mariadb-10.8 90.20% <ø> (ø)
ubuntu-latest_3.8_mysql-5.7 90.91% <ø> (ø)
ubuntu-latest_3.8_mysql-8.0 92.28% <ø> (ø)
ubuntu-latest_3.9_mariadb-10.3 90.06% <ø> (ø)
ubuntu-latest_3.9_mariadb-10.4 90.06% <ø> (ø)
ubuntu-latest_3.9_mariadb-10.5 90.04% <ø> (ø)
ubuntu-latest_3.9_mariadb-10.6 90.04% <ø> (ø)
ubuntu-latest_3.9_mariadb-10.7 90.04% <ø> (ø)
ubuntu-latest_3.9_mariadb-10.8 90.04% <ø> (ø)
ubuntu-latest_3.9_mysql-5.7 90.74% <ø> (ø)
ubuntu-latest_3.9_mysql-8.0 92.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiomysql/connection.py 84.26% <ø> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

laozhp commented 1 year ago

change to

            logger.debug(
                "Received public key:\n%s",
                self.server_public_key.decode('ascii')
            )

may be better