• 
      

    Add a Django patch to work around a mysqlclient incompatibility.

    Review Request #11898 — Created Jan. 3, 2022 and submitted

    Information

    Django Evolution
    release-2.x

    Reviewers

    Django, up through 1.11, made an assumption that mysqlclient's
    database connection class had bytes in a mapping of internal data type
    converters. This assumption worked in Python 2.7, since bytes and
    str were the same thing, but it broke on Python 3. The mysqlclient
    developers temporarily added compatibility for this, but have recently
    removed that as of mysqlclient 2.1, since Django 2.0+ doesn't exhibit
    this problem.

    This change adds a patch to work around that problem. It pre-populates
    the needed bytes mapping in the conversion map that Django sets up and
    passes to mysqlclient. Django's improper logic will still kick in, but
    it will no longer fail on newer versions of mysqlclient without that
    workaround.

    Tested MySQL support on Python 3 on Django 1.6 through 2.0, with
    mysqlclient 1.4.6, 2.0, and 2.1.

    Summary ID
    Add a Django patch to work around a mysqlclient incompatibility.
    Django, up through 1.11, made an assumption that `mysqlclient`'s database connection class had `bytes` in a mapping of internal data type converters. This assumption worked in Python 2.7, since `bytes` and `str` were the same thing, but it broke on Python 3. The `mysqlclient` developers temporarily added compatibility for this, but have recently removed that as of `mysqlclient 2.1`, since Django 2.0+ doesn't exhibit this problem. This change adds a patch to work around that problem. It pre-populates the needed `bytes` mapping in the conversion map that Django sets up and passes to `mysqlclient`. Django's improper logic will still kick in, but it will no longer fail on newer versions of `mysqlclient` without that workaround.
    ac38637bb46233979b45990f46940555a314e3b4
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-2.x (804b1ad)