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 "test.py", 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:
try:
print(f"'None' refcount: {sys.getrefcount(None)}")
connection = mysql.connector.connect(
host = host,
port = port,
user = user,
passwd = password,
database = dbname
)
connection.disconnect()
time.sleep(0.01)
except Error:
print("error")
break

Options: ReplyQuote


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


Sorry, you can't reply to this topic. It has been closed.

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.