Skip to content

Conversation

@RensDimmendaal
Copy link
Contributor

@RensDimmendaal RensDimmendaal commented Jan 25, 2026

W this pr detect_mime returns None if the inputs are not bytes instead of raising an error.
It already returns None if no mimetype was found in the bytes input.

I noticed I was doing checks for isinstance(data, bytes) or putting it in a try/except block when using this function and I figured it might be better to handle this case in here instead.

@RensDimmendaal RensDimmendaal requested a review from jph00 January 25, 2026 19:18
@RensDimmendaal RensDimmendaal changed the title fix: return None from detect_mime for non-bytes input Return None from detect_mime for non-bytes input Jan 25, 2026
@jph00 jph00 added the enhancement New feature or request label Jan 27, 2026
@jph00 jph00 merged commit 5bbb17f into main Jan 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants