esnme/ultramysql — Issue #9: Non existing db when connecting gives cryptic error
Author: hjlarsson
Created: 2012-02-27 10:32:54+00:00
State: open

When connecting to a db and specifying a database that does not exist you get the error "SystemError: error return without exception set". Setting the db arg to a empty string is a work around.

Minimal example:

import unittest, umysql

class TestMySQL(unittest.TestCase):
def testUnique(self):
conn = umysql.Connection()
conn.connect ('127.0.0.1', 3306, 'testuser', 'testuser', 'NO_EXISTING_DB')

conn.close()

if __name__ == '__main__':
unittest.main()