Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filetype.guess not working with bytes when used in AWS Lambda environment #194

Open
miguel-martinr opened this issue Feb 1, 2025 · 0 comments

Comments

@miguel-martinr
Copy link

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 (?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant