MySQL Forums
Forum List  »  Connector/Python

deallocating None issue with connect/disconnect
Posted by: Marcel M
Date: April 28, 2023 08:35AM

Hi all,

I run into a "deallocating None" error, if I use connect()/disconnect():
'None' refcount: 4
'None' refcount: 3
'None' refcount: 2
Fatal Python error: deallocating None
Python runtime state: initialized

Current thread 0x00007f9dfb640740 (most recent call first):
File "", line 19 in <module>

Any ideas? Here my environment:
python: 3.8.10
OS: ubuntu 20.04
mysql-connector-python: 8.0.33

Samplecode to reproduce, just replace mysql.connector.connect() parameter with matching once:

import mysql.connector
from mysql.connector import Error
import sys
import time

if __name__ == "__main__":
while True:
print(f"'None' refcount: {sys.getrefcount(None)}")
connection = mysql.connector.connect(
host = host,
port = port,
user = user,
passwd = password,
database = dbname
except Error:

Options: ReplyQuote

Written By
deallocating None issue with connect/disconnect
April 28, 2023 08:35AM

Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.