代码当前检查类型(bol)=bytearray,但如何让它对长文本列执行相同的操作?我试过使用pure=true/false以及raw=true/false。我已经安装了mysql python连接器8.0.6,运行python 3.5.4
对于longtext
列,它将返回b'data'
vs data
class MyConverter(mysql.connector.conversion.MySQLConverter):
def row_to_python(self, row, fields):
row = super(MyConverter, self).row_to_python(row, fields)
def to_unicode(col):
if type(col) == bytearray:
return col.decode('utf-8')
return col
return[to_unicode(col) for col in row]
目前没有回答
相关问题 更多 >
编程相关推荐