changed: -crs.execute("""INSERT INTO blobtable SET b="%s" """ % escape_string(binarydata)) #crs.execute("""INSERT INTO blobtable SET b="%s" """ % escape_string(binarydata)) # PKM: actually, I've found that this step isn't necessary. Just # remove the quotes, e.g.: crs.execute("INSERT INTO blobtable SET b=%s" % binarydata)