Just guessing, but in python strings are byte arrays, so I don't think there is any error in that. Or maybe there is a problem with the form sending the content and the validator expecting a filename, or the inverse.
Just my 2 cents, and as noone answered this I thought it may help

