-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Extension for MIME type is not recognized #111637
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
Comments
The type is |
Yes, I must have made a mistake when I copied the MIME type on my Linux system. But I still can't get any further on my Windows system. Python 3.11.6 (tags/v3.11.6:8b6ee5b, Oct 2 2023, 14:57:12) [MSC v.1935 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import mimetypes
>>> print(mimetypes.guess_extension("application/vnd.openxmlformats-officedocument.wordprocessingml.document"))
None
>>> |
Do you have Office installed? Windows doesn't have an exhaustive database built-in, it allows applications to register their own MIME types when they are installed. |
It may know a display name without having a MIME registration - those are separate things in Windows. Your code works fine for me with Python 3.11 and Word installed, so I would assume it's simply not registered in your case. There's nothing we can do about that - send feedback to Microsoft through the Windows Feedback tool? |
@zooba maybe Devs should than change https://docs.python.org/3/library/mimetypes.html from To something like I personally find it very confusing otherwise |
You're more than welcome to create a pull request with the updates. You'll find the |
Unfortunately English is not my mother tongue, I would suggest someone from the USA or the UK can formulate this much better than I can. |
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
I currently have a problem with guessing file extensions from the MIME
type, unfortunately. I understood that only files with a registry at
IANA can be guessed and checked the linked page. As I understand, my
affected data is registered with IANA.
The IANA link:
https://www.iana.org/assignments/media-types/application/vnd.openxmlformats-officedocument.wordprocessingml.document
I hoped to see
.docx
as a return valueCPython versions tested on:
3.11
Operating systems tested on:
Linux, Windows
Linked PRs
The text was updated successfully, but these errors were encountered: