TypeError: not all arguments converted during string formatting

I hit this error with some python code:

TypeError: not all arguments converted during string formatting

I took a long time to finally trace it to this:

output = 'inserting %s report centers for ' % (number_of_segments, column_set_name)

It means I provided 2 values to replace (number_of_segments, column_set_name) but only provided one place holder (%s).

This is the correct code:

output = 'inserting %s report centers for %s' % (number_of_segments, column_set_name)

 

Technorati tags: ,
Custom Search