1

So I tried looking for some answer eg(here,here and here) but the solutions don't make any sense. I am sending bytes to Celery. and for some reason it tells me that it's JSON-serializable while I am not even using JSON

write_file_aws.delay(file_full_name, file_to_put) #file_fill_name - str type, file_to_put - bytes type

and there I have the error I tried also decoding it but I had this problem

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 113: invalid continuation byte

so I tried this solution and just another error. Why can't I send a byte-type variable to celery? Is that something impossible to send to a celery function?

backend framework- Flask.

Patch
  • 694
  • 1
  • 10
  • 29

1 Answers1

1

The simple answer is that you just can't pass a byte type variable to a Celery function. If you have to you can turn it to a list save it in a database then call it inside the function. Or encode it to base64 and then in thr function decode it.

Patch
  • 694
  • 1
  • 10
  • 29