There are 22 questions and growing on [python] file TypeError: expected a string or other character buffer object, which you get whenever you try file.write()
for anything other than a string: a list, list of strings, mixed list of numbers and strings, list-of-lists, any other arbitrary data structure... But canonically the same thing.
The answer is always that you have to convert the answer into one or more strings or separate lines each being a string. Or just ' '.join(...)
So the answer varies slightly depending on the input.
How should we canonicalize them? Which one(s) should be canonical? Most have bad titles, and many don't have very general answers (the tagging and titling for SEO can be improved). I don't think we need 22 badly-named questions.
Click through and go read the list of 22, it's not very stellar and none of them stands out.