You can just surround the offending value with str(...). You should probably be doing that anyway, because the value might be a number or something else not stringish.