sql2graphite - TypeError: not enough arguments for format string
Just ran into following issue.
Traceback (most recent call last):
File "/usr/local/bin/sql-to-graphite", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/sql_to_graphite/__init__.py", line 55, in main
get_executor(dsn),
File "/usr/local/lib/python2.7/dist-packages/sql_to_graphite/__init__.py", line 25, in run
data = map(executor, queries)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 942, in execute
return self._execute_text(object, multiparams, params)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1104, in _execute_text
statement, parameters
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
context)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1416, in _handle_dbapi_exception
util.reraise(*exc_info)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
context)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 507, in do_execute
cursor.execute(statement, parameters)
File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 187, in execute
query = query % tuple([db.literal(item) for item in args])
TypeError: not enough arguments for format string
Result is, that I've created a sql statement with a >>%<< inside. I need to escape it (transform it to >>%%<<) and all is fine.
Trackbacks
The author does not allow comments to this entry
Comments
Display comments as Linear | Threaded