[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pymysql.err.InterfaceError after some hours of usage

Hello, i use 'module pymysql' for connectivity in my wsgi scripts. For some reason after some hours of i.e. '' i get the following error when the script tries to run:
Do you know why this is happening?!

Error: 500 Internal Server Error
Sorry, the requested URL '' caused an error:

Internal Server Error
InterfaceError("(0, '')",)
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/", line 862, in _handle
  File "/usr/lib/python3.6/site-packages/", line 1740, in wrapper
    rv = callback(*a, **ka)
  File "/home/nikos/wsgi/", line 143, in displayall
  File "/home/nikos/wsgi/", line 93, in convert
    cur.execute('''SELECT file FROM files''')
  File "/usr/lib64/python3.6/site-packages/pymysql/", line 170, in execute
    result = self._query(query)
  File "/usr/lib64/python3.6/site-packages/pymysql/", line 328, in _query
  File "/usr/lib64/python3.6/site-packages/pymysql/", line 516, in query
    self._execute_command(COMMAND.COM_QUERY, sql)
  File "/usr/lib64/python3.6/site-packages/pymysql/", line 750, in _execute_command
    raise err.InterfaceError("(0, '')")
pymysql.err.InterfaceError: (0, '')

I only use this opening statement in the beginning of my scripts.

conn = pymysql.connect( host='localhost', user='user', password='pass', db='counters' )
cur = conn.cursor()

Then i execute insert and update sql statements but i never close the connection. I presume python closes the connection when the script ends. Doesn't it?