This error is caused by trying to concatenate a string with a NoneType object. In your code, the variable receive_id_12 is likely assigned the value None at the time of concatenation.

To fix this issue, you need to ensure that receive_id_12 is not None before concatenating it with the rest of the string. You can do this by using an if statement or a default value.

Here's an example of using an if statement to handle the None case:

payload = '{"auth_token":"Yx2-_jm49oc584QBzLPT","task_id":12,"receive_id":'
if receive_id_12 is not None:
    payload += str(receive_id_12)
else:
    payload += 'default_value'  # Replace 'default_value' with an appropriate default value
payload += '}'

Alternatively, you can use the str() function to convert receive_id_12 to a string, and provide a default value using the or operator:

payload = '{"auth_token":"Yx2-_jm49oc584QBzLPT","task_id":12,"receive_id":' + str(receive_id_12 or 'default_value') + '}'

Replace 'default_value' with an appropriate default value for your use case

Traceback most recent call last File dockerpythonrujiaindexpy line 86 in module payload = auth_tokenYx2-_jm49oc584QBzLPTtask_id12receive_id + receive_id_12 + TypeError can only concatenate str

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

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