The error message suggests that the current_data variable contains bytes instead of strings. The join() function expects a sequence of strings, so you need to convert the bytes to strings before joining them.

Here's an example of how you can decode the bytes to strings before joining:

data_string = ''.join(data.decode('utf-8') for data in current_data)

In this code, each data element in current_data is decoded using the UTF-8 encoding and then joined together to form the data_string.

data_string = joincurrent_datadecodeutf-8 ^^^^^^^^^^^^^^^^^^^^^TypeError sequence item 0 expected str instance bytes found

原文地址: https://www.cveoy.top/t/topic/i5NX 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录