GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-84852: Add MIME types for .eot, ,otf, .ttf, .woff and .woff2 fonts by sahil290791 · Pull Request #20199 · python/cpython

Conversation

@sahil290791

@sahil290791 sahil290791 commented May 19, 2020 •
edited by hugovk
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Add missing font mime types

Fixes #84852.

Currently the guess_type method doesnt work for fonts of type: .eot, .woff, .woff2, .otf and .ttf
I have added the neccessary mimetypes for these fonts

Reference: https://codingstill.com/2013/01/set-mime-types-for-web-fonts-in-iis/

[bpo-40675](https://bugs.python.org/issue40675): Summary of the changes made
  • Issue: Add missing mimetypes for fonts #84852

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vasuadari, smelchior, minchinweb, and chadlwilson reacted with thumbs up emoji
All reactions
  • 👍 4 reactions
@sahil290791
Add fonts .woff, .woff2, .eot and .ttf to mimetypes
4ce88d1
@sahil290791
sahil290791 requested a review from a team as a code owner May 19, 2020 01:00
@the-knights-who-say-ni the-knights-who-say-ni added the CLA not signed label May 19, 2020
@the-knights-who-say-ni

This comment was marked as resolved.

Sign in to view
@bedevere-bot bedevere-bot added the awaiting review label May 19, 2020
@sahil290791 sahil290791 changed the title Add fonts .woff, .woff2, .eot and .ttf to mimetypes bpo-40675: Add fonts .woff, .woff2, .eot and .ttf to mimetypes May 19, 2020
@blurb-it
📜🤖 Added by blurb_it.
621f88e
tiran
tiran previously requested changes May 19, 2020
View reviewed changes
Comment thread Lib/mimetypes.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting changes and removed awaiting review labels May 19, 2020
@bedevere-bot

This comment was marked as resolved.

Sign in to view
@sahil290791
Sort .woff, .woff2, .eot, .ttf and .otf alphabetically
1a0e8ed
@sahil290791 sahil290791 changed the title bpo-40675: Add fonts .woff, .woff2, .eot and .ttf to mimetypes bpo-40675: Add fonts .woff, .woff2, .eot, .otf and .ttf to mimetypes May 19, 2020
@sahil290791
sahil290791 requested review from tiran and removed request for a team May 19, 2020 16:04
@csabella csabella removed the CLA not signed label May 23, 2020
@the-knights-who-say-ni the-knights-who-say-ni added the CLA not signed label May 23, 2020
@csabella

This comment was marked as resolved.

Sign in to view
@sahil290791

This comment was marked as resolved.

Sign in to view
@the-knights-who-say-ni the-knights-who-say-ni added CLA signed and removed CLA not signed labels May 27, 2020
@sahil290791

This comment was marked as resolved.

Sign in to view
@sahil290791

This comment was marked as resolved.

Sign in to view
@bedevere-bot bedevere-bot added awaiting change review and removed awaiting changes labels May 27, 2020
@bedevere-bot

This comment was marked as resolved.

Sign in to view
@sahil290791

sahil290791 commented Jul 26, 2020

Copy link
Copy Markdown
Contributor Author

@tiran @csabella Please let me know if anything else is pending from my side?

It would be great if this can be merged as currently I am working by adding certain if conditions in my current project.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tiran
tiran removed their request for review April 18, 2021 07:18
@azimovMichael

azimovMichael commented Aug 24, 2021

Copy link
Copy Markdown

Hi, @tiran @csabella any estimation on if and when this will be merged?
Also, @sahil290791, you don't need if conditions, you can add these types dynamically with:
mimetypes.add_type('application/font-woff2', '.woff2')

sahil290791 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sahil290791

sahil290791 commented Aug 24, 2021

Copy link
Copy Markdown
Contributor Author

Thanks @azimovMichael for the suggestion, will use dynamic approach currently.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@minchinweb

minchinweb commented Oct 2, 2021

Copy link
Copy Markdown

In 2017, the IANA approved a "fonts" top level media type, and so the official MIME types are now:

Name Template Reference
collection font/collection RFC8081
otf font/otf [RFC8081]
sfnt font/sfnt [RFC8081]
ttf font/ttf [RFC8081]
woff font/woff [RFC8081]
woff2 font/woff2 [RFC8081]

source

hugovk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@minchinweb minchinweb mentioned this pull request Oct 2, 2021
Add MIME types for web fonts getpelican/pelican#2929
Merged
2 of 3 tasks
@ezio-melotti ezio-melotti removed the CLA signed label Jul 13, 2022
@bedevere-app bedevere-app Bot mentioned this pull request Mar 25, 2024
Add missing mimetypes for fonts #84852
Closed
@hugovk hugovk changed the title bpo-40675: Add fonts .woff, .woff2, .eot, .otf and .ttf to mimetypes gh-84852: Add fonts .woff, .woff2, .eot, .otf and .ttf to mimetypes Nov 4, 2024
@hugovk
hugovk dismissed tiran’s stale review November 4, 2024 15:26

the changes were made and tiran removed their request for review

@bedevere-app bedevere-app Bot added awaiting review and removed awaiting change review labels Nov 4, 2024
hugovk added 4 commits November 4, 2024 17:28
@hugovk
Merge branch 'main' into master
578bea4
@hugovk
Add newline to fix lint, use gh issue number instead of bpo
78dcd11
@hugovk
Remove duplicates added in merge conflict resolution
fc668fd
@hugovk
Rename font MIME types to follow RFC 8081
b08efee
https://www.iana.org/assignments/media-types/media-types.xhtml#font
@hugovk hugovk added the type-feature A feature request or enhancement label Nov 4, 2024
@hugovk
Update MS Embedded OpenType MIME type
d4cdfdc
@hugovk hugovk changed the title gh-84852: Add fonts .woff, .woff2, .eot, .otf and .ttf to mimetypes gh-84852: Add MIME types for .eot, ,otf, .ttf, .woff and .woff2 fonts Nov 4, 2024
@hugovk

hugovk commented Nov 4, 2024

Copy link
Copy Markdown
Member

I've updated this to fix the merge conflict, use the RFC 8081 MIME types, corrected the Embedded OpenType (EOT) MIME type (append object: application/vnd.ms-fontobject), and added a What's New entry.

minchinweb reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

colesbury
colesbury approved these changes Nov 11, 2024
View reviewed changes
Comment thread Lib/test/test_mimetypes.py Outdated
self.assertEqual(mimetypes.guess_extension('application/postscript'), '.ps')
self.assertEqual(mimetypes.guess_extension('application/vnd.apple.mpegurl'), '.m3u')
self.assertEqual(mimetypes.guess_extension('application/vnd.ms-excel'), '.xls')
self.assertEqual(mimetypes.guess_extension('application/vnd.ms-fontobject'), '.eot')

@colesbury colesbury Nov 11, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is going to conflict with the refactoring in #126412.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hugovk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Nov 11, 2024
terryjreedy
terryjreedy reviewed Nov 11, 2024
View reviewed changes
Comment thread Lib/mimetypes.py
Comment on lines +546 to +549
'.otf' : 'font/otf',
'.ttf' : 'font/ttf',
'.woff' : 'font/woff',
'.woff2' : 'font/woff2',

@terryjreedy terryjreedy Nov 11, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified from the RFC that these 4 lines and hence the corresponding test lines are correct. There is no reference I see for the vnd-ms addition so cannot verify. The merge conflict will be in the tests due to the switch to using subtests, which looks good to me. So merge that first and fix this.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hugovk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@hugovk hugovk Nov 11, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for verifying.

application/vnd.ms-fontobject is vendor specific and can be seen for example at:

  • https://www.iana.org/assignments/media-types/application/vnd.ms-fontobject
  • https://developer.mozilla.org/en-US/docs/Web/HTTP/MIME_types/Common_types

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hugovk
Merge remote-tracking branch 'upstream/main'
2ea2041
hugovk
hugovk reviewed Nov 11, 2024
View reviewed changes
Comment thread Doc/whatsnew/3.14.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@hugovk
Re-add newline
77a094a
@hugovk
hugovk merged commit 599bfc9 into python:main Nov 12, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Nov 12, 2024
@hugovk

hugovk commented Nov 12, 2024

Copy link
Copy Markdown
Member

Thank you @sahil290791 for the initial PR and everyone else for the reviews!

sahil290791 reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sahil290791

sahil290791 commented Nov 12, 2024

Copy link
Copy Markdown
Contributor Author

Thanks @hugovk and the reviewers for getting this reviewed and merged. 😃

hugovk reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

picnixz pushed a commit to picnixz/cpython that referenced this pull request Dec 8, 2024
@sahil290791 @blurb-it
@hugovk @picnixz
pythongh-84852: Add MIME types for .eot, ,otf, .ttf, .woff and .woff2…
f716317
… fonts (python#20199)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <[email protected]>
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
@sahil290791 @blurb-it
@hugovk @ebonnal
pythongh-84852: Add MIME types for .eot, ,otf, .ttf, .woff and .woff2…
36a08e0
… fonts (python#20199)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <[email protected]>
@timbru31 timbru31 mentioned this pull request Mar 11, 2025
aws s3 sync doesn't guess MIME type for .woff file aws/aws-cli#1249
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hugovk hugovk hugovk left review comments
@terryjreedy terryjreedy terryjreedy left review comments
@colesbury colesbury colesbury approved these changes
+1 more reviewer
@tiran tiran tiran left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

type-feature A feature request or enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add missing mimetypes for fonts

Uh oh!

There was an error while loading. Please reload this page.

11 participants

@sahil290791 @the-knights-who-say-ni @bedevere-bot @csabella @azimovMichael @minchinweb @hugovk @tiran @colesbury @terryjreedy @ezio-melotti
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.