成功解决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

相关文章
|
4月前
|
JSON Java 数据格式
JSON parse error: Unexpected character (‘t‘ (code 116)): was expecting double-quote to start field n
JSON parse error: Unexpected character (‘t‘ (code 116)): was expecting double-quote to start field n
|
6月前
【报错】 “TypeError: Cannot read properties of undefined (reading ‘split‘)“
【报错】 “TypeError: Cannot read properties of undefined (reading ‘split‘)“
830 0
|
数据安全/隐私保护 Python
TypeError: a bytes-like object is required, not ‘str‘,如何解决?
TypeError: a bytes-like object is required, not ‘str‘,如何解决?
123 0
error C2041: illegal digit ‘9‘ for base ‘8‘ | error C2059: syntax error: ‘bad suffix on number‘
error C2041: illegal digit ‘9‘ for base ‘8‘ | error C2059: syntax error: ‘bad suffix on number‘
139 0
解决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'
463 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
1277 0
C - error: converting to execution character set:Illegal byte sequence
【TP5.1】variable type error: array
【TP5.1】variable type error: array
178 0
【TP5.1】variable type error: array