-
Notifications
You must be signed in to change notification settings - Fork 24
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
mimetype guessing no longer working in python3.12 #40
Comments
In python3.13 it looks like mimetypes.guess_type doesn't throw a TypeError but can handle bytes as opposed to strings so it is probably only 3.12 that is the problem. |
More specifically, the change to not throw TypeError seems to appear in python 3.12.3.
|
This was referenced Jan 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current mimetype guessing relies on mimetypes.guess_type throwing TypeError on bytes. In Python 3.12, it no longer does, it just returns that there is no match. Easily illustrated by the following command:
For pyFreenet3 this means that no files will get any default mime types set since guess_type is always called with a bytes argument first, in fcp3/node.py in the guessMimeType. The different result can be seen like this:
The text was updated successfully, but these errors were encountered: