成功解决TypeError: sequence item 0: expected str instance, bytes found

简介: 成功解决TypeError: sequence item 0: expected str instance, bytes found

解决问题


TypeError: sequence item 0: expected str instance, bytes found

image.png




解决思路


类型错误:序列项0:应为str实例,找到个字节




解决方法


说明没有读取到,将读入到的字符串转为字节即可!


("".join(data)) 改为字符串读入

image.png

相关文章
|
Python
TypeError: int() argument must be a string, a bytes原因
Python开发过程中,使用int()函数来转换或生成int类型的数据时,如果Python抛出并提示TypeError: int() argument must be a string, a bytes-like object or a real number, not 'complex',那么原因在于传递给int()函数的参数类型有误,正如TypeError的提示,int()函数的参数必须是string字符串(数值字符串)、类似字节对象、real number数字等,而不可以是complex复数类型的数据。
391 0
|
数据安全/隐私保护 Python
TypeError: a bytes-like object is required, not ‘str‘,如何解决?
TypeError: a bytes-like object is required, not ‘str‘,如何解决?
解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
483 0
TypeError: sequence item 0: expected string, int found
TypeError: sequence item 0: expected string, int found
|
IDE 开发工具
C - error: converting to execution character set:Illegal byte sequence
C - error: converting to execution character set:Illegal byte sequence
1385 0
C - error: converting to execution character set:Illegal byte sequence
成功解决ParserError: Error tokenizing data. C error: Expected 2 fields in line 53, saw 3
成功解决ParserError: Error tokenizing data. C error: Expected 2 fields in line 53, saw 3
|
数据库
Incorrect result size: expected 1, actual 2
Incorrect result size: expected 1, actual 2
950 0
|
关系型数据库 MySQL 数据库
当你遇到Error: ER_TRUNCATED_WRONG_VALUE_FOR_FIELD: Incorrect string value:
当你遇到Error: ER_TRUNCATED_WRONG_VALUE_FOR_FIELD: Incorrect string value:

热门文章

最新文章