Skip to content

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/", line 55, in main get_executor(dsn), File "/usr/local/lib/python2.7/dist-packages/sql_to_graphite/", line 25, in run data = map(executor, queries) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/", line 942, in execute return self._execute_text(object, multiparams, params) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/", line 1104, in _execute_text statement, parameters File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/", line 1200, in _execute_context context) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/", line 1416, in _handle_dbapi_exception util.reraise(*exc_info) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/", line 1193, in _execute_context context) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/", line 507, in do_execute cursor.execute(statement, parameters) File "/usr/local/lib/python2.7/dist-packages/MySQLdb/", 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.

Translate to de es fr it pt ja

Categories: coding
Vote for articles fresher than 7 days!
Derzeitige Beurteilung: 1 of 5, 2 Stimme(n) 1780 hits


No Trackbacks


Display comments as Linear | Threaded

No comments

The author does not allow comments to this entry

Add Comment

Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
To leave a comment you must approve it via e-mail, which will be sent to your address after submission.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.

Markdown format allowed
Form options