Message 293249 - Python tracker

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Content
And the underlying problem causing this:

$ python -c 'import mimetypes;print(mimetypes.guess_all_extensions("image/jpeg"))'
['.jpeg', '.jpg', '.jpe']
$ python -c 'import mimetypes;print(mimetypes.guess_all_extensions("image/jpeg"))'
['.jpg', '.jpe', '.jpeg']
$ python -c 'import mimetypes;print(mimetypes.guess_all_extensions("image/jpeg"))'
['.jpg', '.jpeg', '.jpe']
$ python -c 'import mimetypes;print(mimetypes.guess_all_extensions("image/jpeg"))'
['.jpe', '.jpg', '.jpeg']
$ python -c 'import mimetypes;print(mimetypes.guess_all_extensions("image/jpeg"))'
['.jpeg', '.jpg', '.jpe']
$ 

If the module can't know which extension is preferred, perhaps guess_extension should just be deprecated and the results of guess_all_extensions sorted on return?

At least that would give us some determinism to work with.