xref: /freebsd/contrib/file/magic/Magdir/python (revision dd41de95a84d979615a2ef11df6850622bf6184e)
1
2#------------------------------------------------------------------------------
3# $File: python,v 1.42 2020/06/04 00:22:50 christos Exp $
4# python:  file(1) magic for python
5#
6# Outlook puts """ too for urgent messages
7# From: David Necas <yeti@physics.muni.cz>
8# often the module starts with a multiline string
90	string/t	"""	Python script text executable
10# MAGIC as specified in Python/import.c (1.0 to 3.7)
11# two bytes of magic followed by "\r\n" in little endian order
120	belong		0x02099900	python 1.0 byte-compiled
13!:mime text/x-bytecode.python
140	belong		0x03099900	python 1.1/1.2 byte-compiled
15!:mime text/x-bytecode.python
160	belong		0x892e0d0a	python 1.3 byte-compiled
17!:mime text/x-bytecode.python
180	belong		0x04170d0a	python 1.4 byte-compiled
19!:mime text/x-bytecode.python
200	belong		0x994e0d0a	python 1.5 byte-compiled
21!:mime text/x-bytecode.python
220	belong		0xfcc40d0a	python 1.6 byte-compiled
23!:mime text/x-bytecode.python
240	belong		0xfdc40d0a	python 1.6 byte-compiled
25!:mime text/x-bytecode.python
260	belong		0x87c60d0a	python 2.0 byte-compiled
27!:mime text/x-bytecode.python
280	belong		0x88c60d0a	python 2.0 byte-compiled
29!:mime text/x-bytecode.python
300	belong		0x2aeb0d0a	python 2.1 byte-compiled
31!:mime text/x-bytecode.python
320	belong		0x2beb0d0a	python 2.1 byte-compiled
33!:mime text/x-bytecode.python
340	belong		0x2ded0d0a	python 2.2 byte-compiled
35!:mime text/x-bytecode.python
360	belong		0x2eed0d0a	python 2.2 byte-compiled
37!:mime text/x-bytecode.python
380	belong		0x3bf20d0a	python 2.3 byte-compiled
39!:mime text/x-bytecode.python
400	belong		0x3cf20d0a	python 2.3 byte-compiled
41!:mime text/x-bytecode.python
420	belong		0x45f20d0a	python 2.3 byte-compiled
43!:mime text/x-bytecode.python
440	belong		0x59f20d0a	python 2.4 byte-compiled
45!:mime text/x-bytecode.python
460	belong		0x63f20d0a	python 2.4 byte-compiled
47!:mime text/x-bytecode.python
480	belong		0x6df20d0a	python 2.4 byte-compiled
49!:mime text/x-bytecode.python
500	belong		0x6ef20d0a	python 2.4 byte-compiled
51!:mime text/x-bytecode.python
520	belong		0x77f20d0a	python 2.5 byte-compiled
53!:mime text/x-bytecode.python
540	belong		0x81f20d0a	python 2.5 byte-compiled
55!:mime text/x-bytecode.python
560	belong		0x8bf20d0a	python 2.5 byte-compiled
57!:mime text/x-bytecode.python
580	belong		0x8cf20d0a	python 2.5 byte-compiled
59!:mime text/x-bytecode.python
600	belong		0x95f20d0a	python 2.5 byte-compiled
61!:mime text/x-bytecode.python
620	belong		0x9ff20d0a	python 2.5 byte-compiled
63!:mime text/x-bytecode.python
640	belong		0xa9f20d0a	python 2.5 byte-compiled
65!:mime text/x-bytecode.python
660	belong		0xb3f20d0a	python 2.5 byte-compiled
67!:mime text/x-bytecode.python
680	belong		0xb4f20d0a	python 2.5 byte-compiled
69!:mime text/x-bytecode.python
700	belong		0xc7f20d0a	python 2.6 byte-compiled
71!:mime text/x-bytecode.python
720	belong		0xd1f20d0a	python 2.6 byte-compiled
73!:mime text/x-bytecode.python
740	belong		0xd2f20d0a	python 2.6 byte-compiled
75!:mime text/x-bytecode.python
760	belong		0xdbf20d0a	python 2.7 byte-compiled
77!:mime text/x-bytecode.python
780	belong		0xe5f20d0a	python 2.7 byte-compiled
79!:mime text/x-bytecode.python
800	belong		0xeff20d0a	python 2.7 byte-compiled
81!:mime text/x-bytecode.python
820	belong		0xf9f20d0a	python 2.7 byte-compiled
83!:mime text/x-bytecode.python
840	belong		0x03f30d0a	python 2.7 byte-compiled
85!:mime text/x-bytecode.python
860	belong		0x04f30d0a	python 2.7 byte-compiled
87!:mime text/x-bytecode.python
880	belong		0xb80b0d0a	python 3.0 byte-compiled
89!:mime text/x-bytecode.python
900	belong		0xc20b0d0a	python 3.0 byte-compiled
91!:mime text/x-bytecode.python
920	belong		0xcc0b0d0a	python 3.0 byte-compiled
93!:mime text/x-bytecode.python
940	belong		0xd60b0d0a	python 3.0 byte-compiled
95!:mime text/x-bytecode.python
960	belong		0xe00b0d0a	python 3.0 byte-compiled
97!:mime text/x-bytecode.python
980	belong		0xea0b0d0a	python 3.0 byte-compiled
99!:mime text/x-bytecode.python
1000	belong		0xf40b0d0a	python 3.0 byte-compiled
101!:mime text/x-bytecode.python
1020	belong		0xf50b0d0a	python 3.0 byte-compiled
103!:mime text/x-bytecode.python
1040	belong		0xff0b0d0a	python 3.0 byte-compiled
105!:mime text/x-bytecode.python
1060	belong		0x090c0d0a	python 3.0 byte-compiled
107!:mime text/x-bytecode.python
1080	belong		0x130c0d0a	python 3.0 byte-compiled
109!:mime text/x-bytecode.python
1100	belong		0x1d0c0d0a	python 3.0 byte-compiled
111!:mime text/x-bytecode.python
1120	belong		0x1f0c0d0a	python 3.0 byte-compiled
113!:mime text/x-bytecode.python
1140	belong		0x270c0d0a	python 3.0 byte-compiled
115!:mime text/x-bytecode.python
1160	belong		0x3b0c0d0a	python 3.0 byte-compiled
117!:mime text/x-bytecode.python
1180	belong		0x450c0d0a	python 3.1 byte-compiled
119!:mime text/x-bytecode.python
1200	belong		0x4f0c0d0a	python 3.1 byte-compiled
121!:mime text/x-bytecode.python
1220	belong		0x580c0d0a	python 3.2 byte-compiled
123!:mime text/x-bytecode.python
1240	belong		0x620c0d0a	python 3.2 byte-compiled
125!:mime text/x-bytecode.python
1260	belong		0x6c0c0d0a	python 3.2 byte-compiled
127!:mime text/x-bytecode.python
1280	belong		0x760c0d0a	python 3.3 byte-compiled
129!:mime text/x-bytecode.python
1300	belong		0x800c0d0a	python 3.3 byte-compiled
131!:mime text/x-bytecode.python
1320	belong		0x8a0c0d0a	python 3.3 byte-compiled
133!:mime text/x-bytecode.python
1340	belong		0x940c0d0a	python 3.3 byte-compiled
135!:mime text/x-bytecode.python
1360	belong		0x9e0c0d0a	python 3.3 byte-compiled
137!:mime text/x-bytecode.python
1380	belong		0xb20c0d0a	python 3.4 byte-compiled
139!:mime text/x-bytecode.python
1400	belong		0xbc0c0d0a	python 3.4 byte-compiled
141!:mime text/x-bytecode.python
1420	belong		0xc60c0d0a	python 3.4 byte-compiled
143!:mime text/x-bytecode.python
1440	belong		0xd00c0d0a	python 3.4 byte-compiled
145!:mime text/x-bytecode.python
1460	belong		0xda0c0d0a	python 3.4 byte-compiled
147!:mime text/x-bytecode.python
1480	belong		0xe40c0d0a	python 3.4 byte-compiled
149!:mime text/x-bytecode.python
1500	belong		0xee0c0d0a	python 3.4 byte-compiled
151!:mime text/x-bytecode.python
1520	belong		0xf80c0d0a	python 3.5.1- byte-compiled
153!:mime text/x-bytecode.python
1540	belong		0x020d0d0a	python 3.5.1- byte-compiled
155!:mime text/x-bytecode.python
1560	belong		0x0c0d0d0a	python 3.5.1- byte-compiled
157!:mime text/x-bytecode.python
1580	belong		0x160d0d0a	python 3.5.1- byte-compiled
159!:mime text/x-bytecode.python
1600	belong		0x170d0d0a	python 3.5.2+ byte-compiled
161!:mime text/x-bytecode.python
1620	belong		0x200d0d0a	python 3.6 byte-compiled
163!:mime text/x-bytecode.python
1640	belong		0x210d0d0a	python 3.6 byte-compiled
165!:mime text/x-bytecode.python
1660	belong		0x2a0d0d0a	python 3.6 byte-compiled
167!:mime text/x-bytecode.python
1680	belong		0x2b0d0d0a	python 3.6 byte-compiled
169!:mime text/x-bytecode.python
1700	belong		0x2c0d0d0a	python 3.6 byte-compiled
171!:mime text/x-bytecode.python
1720	belong		0x2d0d0d0a	python 3.6 byte-compiled
173!:mime text/x-bytecode.python
1740	belong		0x2f0d0d0a	python 3.6 byte-compiled
175!:mime text/x-bytecode.python
1760	belong		0x300d0d0a	python 3.6 byte-compiled
177!:mime text/x-bytecode.python
1780	belong		0x310d0d0a	python 3.6 byte-compiled
179!:mime text/x-bytecode.python
1800	belong		0x320d0d0a	python 3.6 byte-compiled
181!:mime text/x-bytecode.python
1820	belong		0x330d0d0a	python 3.6 byte-compiled
183!:mime text/x-bytecode.python
1840	belong		0x3e0d0d0a	python 3.7 byte-compiled
185!:mime text/x-bytecode.python
1860	belong		0x3f0d0d0a	python 3.7 byte-compiled
187!:mime text/x-bytecode.python
1880	belong		0x400d0d0a	python 3.7 byte-compiled
189!:mime text/x-bytecode.python
1900	belong		0x410d0d0a	python 3.7 byte-compiled
191!:mime text/x-bytecode.python
1920	belong		0x420d0d0a	python 3.7 byte-compiled
193!:mime text/x-bytecode.python
1940	belong		0x480d0d0a	python 3.8 byte-compiled
195!:mime text/x-bytecode.python
1960	belong		0x490d0d0a	python 3.8 byte-compiled
197!:mime text/x-bytecode.python
1980	belong		0x520d0d0a	python 3.8 byte-compiled
199!:mime text/x-bytecode.python
2000	belong		0x530d0d0a	python 3.8 byte-compiled
201!:mime text/x-bytecode.python
2020	belong		0x540d0d0a	python 3.8 byte-compiled
203!:mime text/x-bytecode.python
2040	belong		0x550d0d0a	python 3.8 byte-compiled
205!:mime text/x-bytecode.python
2060	belong		0x5c0d0d0a	python 3.9 byte-compiled
207!:mime text/x-bytecode.python
2080	belong		0x5d0d0d0a	python 3.9 byte-compiled
209!:mime text/x-bytecode.python
2100	belong		0x5e0d0d0a	python 3.9 byte-compiled
211!:mime text/x-bytecode.python
2120	belong		0x5f0d0d0a	python 3.9 byte-compiled
213!:mime text/x-bytecode.python
2140	belong		0x600d0d0a	python 3.9 byte-compiled
215!:mime text/x-bytecode.python
2160	belong		0x610d0d0a	python 3.9 byte-compiled
217!:mime text/x-bytecode.python
218
2190	search/1/w	#!\040/usr/bin/python	Python script text executable
220!:strength + 15
221!:mime text/x-script.python
2220	search/1/w	#!\040/usr/local/bin/python	Python script text executable
223!:strength + 15
224!:mime text/x-script.python
2250	search/10/w	#!\040/usr/bin/env\040python	Python script text executable
226!:strength + 15
227!:mime text/x-script.python
228
229
230# from module.submodule import func1, func2
2310	search/8192	import
232>0	regex		\^from[\040\t]+([A-Za-z0-9_]|\\.)+[\040\t]+import.*$	Python script text executable
233!:strength + 15
234!:mime text/x-script.python
235
236# def __init__ (self, ...):
2370	search/4096	def\ __init__
238>&0	search/64 self	Python script text executable
239!:strength + 15
240!:mime text/x-script.python
241
242# if __name__ == "__main__":
2430 search/4096 if\ __name__
244>&0 search/64 '__main__'	Python script text executable
245>&0 search/64 "__main__"	Python script text executable
246!:strength + 15
247!:mime text/x-script.python
248
249# import module [as abrev]
2500	search/8192	import
251>0	regex	\^import\ [_[:alpha:]]+\ as\ [[:alpha:]][[:space:]]*$ Python script text executable
252!:mime text/x-script.python
253
254# comments
255#0	search/4096	'''
256#>&0	regex	.*'''$	Python script text executable
257#!:mime text/x-script.python
258
259#0	search/4096	"""
260#>&0	regex	.*"""$	Python script text executable
261#!:mime text/x-script.python
262
263# try:
264# except: or finally:
265# block
2660	search/4096	try:
267>&0	regex	\^[[:space:]]*except.*:$	Python script text executable
268!:strength + 15
269!:mime text/x-script.python
270>&0	search/4096	finally:	Python script text executable
271!:mime text/x-script.python
272
273# class name[(base classes,)]: [pass]
2740	search/8192	class
275>0	regex	\^class\ [_[:alpha:]]+(\\(.*\\))?(\ )*:([\ \t]+pass)?$		Python script text executable
276!:strength + 15
277!:mime text/x-script.python
278
279# def name(*args, **kwargs):
2800	search/8192	def\
281>0	regex	 \^[[:space:]]{0,50}def\ {1,50}[_a-zA-Z]{1,100}
282>>&0	regex	 \\(([[:alpha:]*_,\ ]){0,255}\\):$ Python script text executable
283!:strength + 15
284!:mime text/x-script.python
285
286# https://numpy.org/devdocs/reference/generated/numpy.lib.format.html
2870	string	\223NUMPY		NumPy data file
288!:mime  application/x-numpy-data
289>6	byte	x			\b, version %d
290>7	byte	x			\b.%d
291#>8	leshort	x			\b, header length=%d
292>10	string	x			\b, description %s
293