I've this code that works just fine locally:
file_bytes = file.file.read()
kind = filetype.guess(file_bytes)
file type is UploadFile from FastAPI. So, file.read() returns a bytes object.
I'm using python 3.10 both locally and in AWS Lambda, but for some reason, in the Lambda environment the result from guess is None for any given file.
FWIW: both local and lambda env are using little endian (?