Which version of Requests are you using? In the current master branch at least there should be no difference. If you track down what happens to the files list in requests.request, you'll find that arguments of type str, bytes and bytearray get passed through as data, whereas for file-like objects, the .read() method is executed and the result of that is used instead.
So the following should produce the same request as your code:
files = [("file", open(path_to_file, 'rb').read())] # Get file contents
headers = {"Authorization": "bearer " + CLIENT.token}
response = requests.request(
"POST",
SETTINGS.URL_FILE_STORAGE,
headers=headers,
files=files
# files= [('file',catalogo)],
)
I would be fairly surprised if the API responds differently to these two versions.
But if it does, and you have data of type bytes that you need to turn into a file-like object, you can simply use io:
import io
files = [("file", io.BytesIO(data))]
headers = {"Authorization": "bearer " + CLIENT.token}
response = requests.request(
"POST",
SETTINGS.URL_FILE_STORAGE,
headers=headers,
files=files
# files= [('file',catalogo)],
)