You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mimetype default list make a wrong guess for illustrator file #87710
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2021-03-18.15:49:43.313>labels= ['3.8', '3.9', '3.10']
title='mimetype default list make a wrong guess for illustrator file'updated_at=<Date2021-03-20.01:55:14.300>user='https://github.com/inkhey'
mimetypes lib consider illustrator file ('.ai') as 'application/postscript' type. This is correct... but also wrong.
Old illustrator file (illustrator 9) are real postscript file but modern one are technically pdf. So guessing .ai as postscript lead to wrong guessing if you're using some software that make decision based on mimetype, you can of course, check both file_extension and mimetype but this remove usefulness of mimetype.
Unfortunately the user is a mannequin. This is quite problematic, since we don't check contents like other mimetype checkers, there is no way of knowing if it is a new .ai file or an old one.
Although, since the last version of AI to produce postscript files was released 25 years ago (see here), it can be assumed that the majority of files are now the modern PDF variation, and so IMO it makes sense to update it.
This Adobe documentation page (see the heading § Create PDF Compatible File option) seems to suggest that the PDF compatibility is an option, not a feature of the format itself. That would make the application/pdf filetype wrong. I don't have access to Adobe Illustrator to confirm what the resulting file looks like without the setting enabled, but this comment on Adobe Forums seems to suggest it's merely a PDF wrapper not viewable in any PDF standards supporting viewer. Yes, you probably still get more useful data out of it treating it as a PDF file instead of as a "traditional" Postscript file (I presume it would still have XMP data, for example), but it's still not PDF as defined by the PDF standards either. So something like application/vnd.adobe.illustrator or just the very nondescript but techically correct application/postscript would still be a better option IMO.
Activity
inkhey commentedon Mar 18, 2021
mimetypes lib consider illustrator file ('.ai') as 'application/postscript' type. This is correct... but also wrong.
Old illustrator file (illustrator 9) are real postscript file but modern one are technically pdf. So guessing .ai as postscript lead to wrong guessing if you're using some software that make decision based on mimetype, you can of course, check both file_extension and mimetype but this remove usefulness of mimetype.
StanFromIreland commentedon Nov 8, 2025
Unfortunately the user is a mannequin. This is quite problematic, since we don't check contents like other mimetype checkers, there is no way of knowing if it is a new .ai file or an old one.
Although, since the last version of AI to produce postscript files was released 25 years ago (see here), it can be assumed that the majority of files are now the modern PDF variation, and so IMO it makes sense to update it.
gh-87710: Update mime type for ``.ai`` (#141239)
hugovk commentedon Nov 12, 2025
Thanks @inkhey and @StanFromIreland!
aapa commentedon Nov 12, 2025
This Adobe documentation page (see the heading § Create PDF Compatible File option) seems to suggest that the PDF compatibility is an option, not a feature of the format itself. That would make the
application/pdffiletype wrong. I don't have access to Adobe Illustrator to confirm what the resulting file looks like without the setting enabled, but this comment on Adobe Forums seems to suggest it's merely a PDF wrapper not viewable in any PDF standards supporting viewer. Yes, you probably still get more useful data out of it treating it as a PDF file instead of as a "traditional" Postscript file (I presume it would still have XMP data, for example), but it's still not PDF as defined by the PDF standards either. So something likeapplication/vnd.adobe.illustratoror just the very nondescript but techically correctapplication/postscriptwould still be a better option IMO.pythongh-87710: Update mime type for ``.ai`` (python#141239)