-
Notifications
You must be signed in to change notification settings - Fork 447
Closed
Description
I'm getting lots of different varieties of this failure but the general idea seems to be that if deprecation warnings raise errors, MySQLdb can't run queries, Python 3.8.0b1:
import warnings
import MySQLdb
# remove this to eliminate errors
warnings.filterwarnings("error", category=DeprecationWarning)
conn = MySQLdb.connect(user="scott", password="tiger", host="localhost", db="test")
cursor = conn.cursor()
cursor.execute("select 1")
output:
Traceback (most recent call last):
File "test3.py", line 9, in <module>
cursor.execute("select 1")
File "/home/classic/dev/sqlalchemy/.tox/py38-mysql/lib/python3.8/site-packages/MySQLdb/cursors.py", line 206, in execute
res = self._query(query)
File "/home/classic/dev/sqlalchemy/.tox/py38-mysql/lib/python3.8/site-packages/MySQLdb/cursors.py", line 312, in _query
db.query(q)
File "/home/classic/dev/sqlalchemy/.tox/py38-mysql/lib/python3.8/site-packages/MySQLdb/connections.py", line 224, in query
_mysql.connection.query(self, query)
MySQLdb._exceptions.ProgrammingError: (1064, <NULL>)
If I try to use charset, I get something different (likely because it is tripping over a deprecation warning -> error somewhere else):
import warnings
import MySQLdb
warnings.filterwarnings("error", category=DeprecationWarning)
conn = MySQLdb.connect(user="scott", password="tiger", host="localhost", db="test", charset="utf8mb4")
cursor = conn.cursor()
cursor.execute("select 1")
raises:
MySQLdb._exceptions.ProgrammingError: (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'H??t\'H??t"1?f\x0f\x1f?\' at line 1')
but what's weird is that it's not raising for a deprecation warning, so it looks like something is happening in the C code
Metadata
Metadata
Assignees
Labels
No labels