Unix file(1) command identifing .pyc

Dmitri I GOULIAEV dmitri.gouliaev at telkel.net
Tue May 28 18:47:02 EDT 2002


Hi, drt !

 On Tue, May 28, 2002 at 02:38:59PM -0700, drt wrote:

> I have added the magic numbers for python and
> successfully tested on 2.2.1 and 2.1.3 on i386 and PowerPC machines.
> Perhaps somebody has ancient Python versions or unusual machines to
> further test this.

dig at telkel.net:~/tmp$ cat /etc/slackware-version 
7.1.0

dig at telkel.net:~/tmp$ file -v
file-3.27
magic data from /etc/magic:/etc/magic

dig at telkel.net:~/tmp$ python -v -c quit 2>&1 | grep Python
Python 1.5.2 (#1, May 28 2000, 18:04:10)  [GCC egcs-2.91.66 19990314/Linux (egcs- on linux2

dig at telkel.net:~/tmp$ file tmp.pyc
tmp.pyc: data
dig at telkel.net:~/tmp$ file -m c0re.jp/c0de/misc/file-3.38-magic-python tmp.pyc
tmp.pyc: python post 1.5 development version compiled bytec
dig at telkel.net:~/tmp$

Hope this help.

Best regards,

-- 
DIG (Dmitri I GOULIAEV)
 
All below this line is added by my e-mail provider.
-------------- next part --------------
0000000 4e99 0a0d 0756 3cf4 0063 0000 0300 0000
0000020 7300 004a 0000 007f 7f00 0003 006b 5a00
0000040 0000 047f 6b00 0001 015a 7f00 0005 026b
0000060 5a00 0002 077f 6400 0000 0065 6900 0003
0000100 0166 6400 0001 0084 8300 0000 5a59 0004
0000120 147f 6400 0002 0084 5a00 0005 0364 5300
0000140 0428 0000 7300 000b 0000 7553 6570 5472
0000160 7268 6165 6364 0000 0000 0001 0002 2973
0000200 0000 7f00 0007 087f 6400 0001 0084 5a00
0000220 0000 0b7f 6400 0002 0084 5a00 0001 107f
0000240 6400 0003 0084 5a00 0002 5352 0428 0000
0000260 4e00 0163 0100 0200 0300 7300 0026 0000
0000300 087f 7f00 0009 0074 6900 0001 0269 7c00
0000320 0000 0183 0100 0a7f 6400 0001 007c 5f00
0000340 0004 0064 5300 0228 0000 4e00 0169 0000
0000360 2800 0005 0000 0973 0000 7400 7268 6165
0000400 6964 676e 0673 0000 5400 7268 6165 7364
0000420 0008 0000 5f5f 6e69 7469 5f5f 0473 0000
0000440 7300 6c65 7366 0007 0000 7572 6e6e 6e69
0000460 2867 0001 0000 0473 0000 7300 6c65 7366
0000500 0008 0000 2f2e 6d74 2e70 7970 0873 0000
0000520 5f00 695f 696e 5f74 085f 7300 0004 0000
0000540 0103 0113 0163 0100 0200 0300 7300 0046
0000560 0000 0b7f 7f00 000c 3978 7f00 000c 007c
0000600 6900 0001 2b6f 0100 0d7f 6400 0001 7f47
0000620 000e 0274 6900 0003 0469 8300 0000 7f01
0000640 000f 0574 6900 0006 0264 8300 0001 7101
0000660 0009 5701 0064 5300 0328 0000 4e00 0173
0000700 0000 2e00 0169 0000 2800 0007 0000 0473
0000720 0000 7300 6c65 7366 0007 0000 7572 6e6e
0000740 6e69 7367 0003 0000 7973 7373 0006 0000
0000760 7473 6f64 7475 0573 0000 6600 756c 6873
0001000 0473 0000 7400 6d69 7365 0005 0000 6c73
0001020 6565 2870 0001 0000 0473 0000 7300 6c65
0001040 7366 0008 0000 2f2e 6d74 2e70 7970 0373
0001060 0000 7200 6e75 000b 0a73 0000 0300 0601
0001100 0d00 0701 1001 6301 0001 0001 0002 0003
0001120 1373 0000 7f00 0010 117f 6400 0001 007c
0001140 5f00 0001 0064 5300 0228 0000 4e00 0069
0001160 0000 2800 0002 0000 0473 0000 7300 6c65
0001200 7366 0007 0000 7572 6e6e 6e69 2867 0001
0001220 0000 0473 0000 7300 6c65 7366 0008 0000
0001240 2f2e 6d74 2e70 7970 0473 0000 7300 6f74
0001260 1070 7300 0002 0000 0103 0328 0000 7300
0001300 0008 0000 5f5f 6e69 7469 5f5f 0373 0000
0001320 7200 6e75 0473 0000 7300 6f74 2870 0000
0001340 0000 0873 0000 2e00 742f 706d 702e 7379
0001360 000b 0000 7553 6570 5472 7268 6165 0764
0001400 7300 0006 0000 0103 030c 050c 0063 0100
0001420 0200 0300 7300 003d 0000 147f 7f00 0015
0001440 0074 8300 0000 007d 7f00 0016 007c 6900
0001460 0002 0083 0100 177f 7400 0003 0469 6400
0001500 0001 0183 0100 187f 7c00 0000 0569 8300
0001520 0000 6401 0000 2853 0002 0000 694e 000a
0001540 0000 0628 0000 7300 000b 0000 7553 6570
0001560 5472 7268 6165 7364 0001 0000 7374 0005
0001600 0000 7473 7261 7374 0004 0000 6974 656d
0001620 0573 0000 7300 656c 7065 0473 0000 7300
0001640 6f74 2870 0001 0000 0173 0000 7400 0873
0001660 0000 2e00 742f 706d 702e 7379 0004 0000
0001700 6574 7473 0014 0873 0000 0300 0c01 0d01
0001720 1001 4e01 0628 0000 7300 0009 0000 6874
0001740 6572 6461 6e69 7367 0004 0000 6974 656d
0001760 0373 0000 7300 7379 0673 0000 5400 7268
0002000 6165 7364 000b 0000 7553 6570 5472 7268
0002020 6165 7364 0004 0000 6574 7473 0028 0000
0002040 7300 0008 0000 2f2e 6d74 2e70 7970 0173
0002060 0000 3f00 0003 0873 0000 0c00 0901 0901
0002100 1c02 000d
0002103


More information about the Python-list mailing list