Uploaded image for project: 'MariaDB Connector/Python'
  1. MariaDB Connector/Python
  2. CONPY-127

Let the connector accept None passwords.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.0.4
    • Fix Version/s: 1.0.5
    • Component/s: Generic
    • Labels:
      None
    • Environment:
      MariaDB 10.5
      Python 3.6
      CentOS 7.8

      Description

      When migrating from the mysql to the mariadb connector, I found out, that when using the socket user identification from 10.5 the password is not ignored.
      So an extra if block is needed to connect to the server.
      using the mysql connector, this code will work:

      db_connection = db_connector.connect(user="root", password=root_pw, unix_socket=socket_path,database="mysql")
      

      But for the mariadb connector it must changed to:

      if root_pw:
                              db_connection = db_connector.connect(user="root", password=root_pw, unix_socket=socket_path, database="mysql")
      else:
                              db_connection = db_connector.connect(user="root",unix_socket=socket_path, database="mysql")
      

      When connect via socket auth, the password will be None, because it is not needed. But the mariadb python module can't handle it. The connect will fail with:

      TypeError: connect() argument  4 must be str, not None
      

        Attachments

          Activity

            People

            Assignee:
            georg Georg Richter
            Reporter:
            mariaTux Frank
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: