In case anybody else runs into this error, my problem was the the file I was reading had multiple sql statements in it (separated by ;s). The cursor.execute() could only handle one of them at a time, or something, and was freaking out when I tried to close it.
Solution:
connection = mysqldb.connect('localhost', 'root', 'password', 'db')
file = open(filename, 'r')
sql_statements = " ".join(file.readlines())
for sql in sql_statements.split(";"): //given file, may need ";\n"
cursor = connection.cursor()
cursor.execute(sql)
cursor.close()