Quantcast
Channel: MySQL Forums - Connector/Python
Viewing all articles
Browse latest Browse all 384

deallocating None issue with connect/disconnect (4 replies)

$
0
0
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

Viewing all articles
Browse latest Browse all 384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>