Skip to content

Add text/x-python2 for Python 2 scripts

This is an alternative to stalled MR !116 (closed), and implements the solution which had the widest support in the discussions on that MR.

Addresses #102, though it doesn't take the approach proposed/requested in that issue (in contrast to MR !116 (closed)).

Create a second subclass of text/x-python, which specifically identifies Python 2 scripts in the same way that text/x-python3 does Python 3 scripts.

Like text/x-python3, text/x-python2 has more-specific magic strings at a higher priority than the ones in text/x-python. Both match the *.py glob at a lower priority than text/x-python.

Basically, if we are able to concretely identify a file as "Python 2 script" or "Python 3 script", we do. Otherwise, it's just "Python script", version neither known nor assumed.

Merge request reports