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.

classification
Title: Clarify Python MIME type
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.9
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: asvetlov, docs@python, jdek
Priority: normal Keywords:

Created on 2019-12-21 14:14 by jdek, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (6)
msg358772 - (view) Author: J. Dekker (jdek) Date: 2019-12-21 14:14
I'd like to add Python's MIME types to a database so that they can be properly used by other services. However, apart from the source code[1][2], I can't find any documentation from Python which highlights this. Is the source code correct here, and can it be taken as the 'official' MIME types from the project?

text/x-python py
application/x-python-code pyc pyo

[1]: https://github.com/python/cpython/blob/19a3d873005e5730eeabdc394c961e93f2ec02f0/Lib/mimetypes.py#L457
[2]: https://github.com/python/cpython/blob/19a3d873005e5730eeabdc394c961e93f2ec02f0/Lib/mimetypes.py#L528
msg358810 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2019-12-23 12:45
Do you mean adding a record to https://www.iana.org/assignments/media-types/media-types.xhtml?
msg358811 - (view) Author: J. Dekker (jdek) Date: 2019-12-23 13:40
An IANA media type assignment would be even better than a '*/x-*' MIME, of course, but my original intention was just to clarify that the MIMEs in the cpython source can be used as documentation for 'which MIME should you use when sending .py,.pyc,.pyo'. 

I'm unsure if Python is eligible for a 'real' assignment, as far as I can tell, the main factor is if they are willing to take a reference implementation as 'a permanent and readily available public specification of the format for the media type' [1].

[1]: https://tools.ietf.org/html/rfc6838#section-4.4
msg358812 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2019-12-23 14:13
If you are not talking about IANA registration (I doubt if Python needs it) what do you propose?
I've missed what do you want to update in Python or its docs to satisfy your needs.
msg358832 - (view) Author: J. Dekker (jdek) Date: 2019-12-23 20:21
I just wanted the intended MIME type for sending python over various mediums to be written down somewhere other than the source code, but I'm not sure where it should go.

Though if you don't think it is necessary then that is fine too, I mostly just wanted someone else's opinion. After looking into it further I couldn't find much on other languages specifically stating which MIME you should use, it's mostly somewhat of an infrequent unofficial convention.

If you don't think there is an appropriate place to put this information, other than the source code itself, then feel free to close this bug. Thank you for your replies, and sorry for wasting your time.
msg358846 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2019-12-24 10:02
As you mentioned, IANA did not registry any programming language except JavaScript; I think that's fine.

You can consider text/x-python and application/x-python-code as unofficial but permanent MIME types that are used in Python written programs at least; feel free to use them.
History
Date User Action Args
2022-04-11 14:59:24adminsetgithub: 83296
2019-12-24 10:02:31asvetlovsetstatus: open -> closed
resolution: not a bug
messages: + msg358846

stage: resolved
2019-12-23 20:21:24jdeksetmessages: + msg358832
2019-12-23 14:13:47asvetlovsetmessages: + msg358812
2019-12-23 13:40:46jdeksetmessages: + msg358811
2019-12-23 12:45:10asvetlovsetnosy: + asvetlov
messages: + msg358810
2019-12-21 14:14:39jdekcreate