TypeError: expected a character buffer object

后端 未结 3 1489
伪装坚强ぢ
伪装坚强ぢ 2020-12-06 01:29

I am running into the following error while writing the value into a file. Can you please help me figure out what is the issue here and how to fix it?

row =         


        
3条回答
  •  没有蜡笔的小新
    2020-12-06 01:42

    I had the same error, in my code:

    s.translate(table)
    

    The s obj was string. The issue was s.translate was expecting a unicode string. So, the fix was to use:

    unicode(s).translate(table)
    

提交回复
热议问题