Add a Django patch to work around a mysqlclient incompatibility.
Review Request #11898 — Created Jan. 2, 2022 and submitted
Django, up through 1.11, made an assumption that
database connection class had
bytesin a mapping of internal data type
converters. This assumption worked in Python 2.7, since
strwere the same thing, but it broke on Python 3. The
developers temporarily added compatibility for this, but have recently
removed that as of
mysqlclient 2.1, since Django 2.0+ doesn't exhibit
This change adds a patch to work around that problem. It pre-populates
bytesmapping in the conversion map that Django sets up and
mysqlclient. Django's improper logic will still kick in, but
it will no longer fail on newer versions of
Tested MySQL support on Python 3 on Django 1.6 through 2.0, with
mysqlclient1.4.6, 2.0, and 2.1.