Comment 4 for bug 1799406

# Sample for recreating
#
# py2 results: https://paste.ubuntu.com/p/JrDMDr9yMk/
# py3 results: https://paste.ubuntu.com/p/n2zt3Bw3VJ/

import locale
import pymysql

class Message():
    def translate(self, desired_locale=None):
        print("translate(desired_local={})".format(desired_locale))
        locale.normalize(desired_locale)

conn = pymysql.connect(user='aodh', password='pw', host='1.2.3.4')
cur = conn.cursor()
cur.execute('SELECT %(var)s', dict(var=99, msg=Message()))