GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-132054: Add ``application/yaml`` to ``mimetypes`` by Kristinita · Pull Request #132056 · python/cpython Conversation
|
|
@Kristinita I think you accidentally included some unrelated changes in your last push |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Type: Reply 💬 @brianschubert, I’m sorry, I made a mistake in the test file and create the new commit that fix tests. I can’t push my changes to GitHub, so I run I can close this pull request, update my CPython fork and send a new pull request. Or should I do something else? I can’t find instructions for this case in Python Developer’s Guide. I apologize for the concern. Thanks. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
No worries! And no need to open a new PR. You can undo the extra changes by running |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@Kristinita please read our AI policy. A |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…mand python#132056 (comment) Signed-off-by: Kristinita <[email protected]>
There was an error while loading. Please reload this page.
|
Type: Fixed ✔️ @brianschubert , done. All checks have passed now. Thanks. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Please could you add it to What's New? https://docs.python.org/3.14/whatsnew/3.14.html#mimetypes And add a test for .yml? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Type: Question ❓ 1. Question
@hugovk, what is the preferred format for tests for non-preferred extensions like 2. Missing testsCurrently, the file
3. Existing test for non-preferred extensionsShould I create a test like the test for the cpython/Lib/test/test_mimetypes.py Lines 177 to 179 in ef17252
4. Simpler adding testsPossibly, it would be nice if adding tests for non-preferred extension will be simpler. For example, the file ("application/yaml", ".yml"), ("audio/mpeg", ".mp2"), ("video/mpeg", ".m1v"), ("video/mpeg", ".mpa"), ("video/mpeg", ".mpe"), ("video/mpeg", ".mpg") Thanks. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
We could add some a test case to check the output of def test_guess_file_type(self): def check_file_type(): for mime_type, ext in ( ("application/yaml", ".yaml"), ("application/yaml", ".yml"), ): with self.subTest(mime_type=mime_type, ext=ext): result, _ = mimetypes.guess_file_type(f"filename{ext}") self.assertEqual(result, mime_type) check_file_type() mimetypes.init() check_file_type() No need to exhaustively fill lots of other preferred+optional extensions, but we could include a few more, such as the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Updated to add tests and a What's New entry.
The What's New for mimetypes is getting a bit sprawling, but we can copyedit that later as part of #123299.
@Kristinita Thank you and congratulations on your first contribution to CPython!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| (Contributed by Hugo van Kemenade in :gh:`129965`.) | ||
|
|
||
| * Add :rfc:`9512` ``application/yaml`` MIME type for YAML files (``.yaml`` | ||
| and ``.yml``). (Contributed by Kristinita in :gh:`132056`.) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@Kristinita We can put your full name here if you like.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@hugovk, thanks for adding the function test_guess_file_type()!
My contribution here is insignificant, and I think it would be more fair if you will add your name instead of my.
(But if the name of the author of the pull request is required, perhaps, Sasha “Nelie” Chernykh instead of Kristinita would be better).
Thanks.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You contribution is not insignificant. I've put both our names there, thanks again!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.