From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "enum" |
|---|
| subject | "Format:PYC (Python compiled bytecode)" |
|---|
| claim | "Magic numbers of the final release of each CPython minor version (the last value of its pre-release series): 2.7 = 62211, 3.0 = 3131, 3.1 = 3151, 3.2 = 3180, 3.3 = 3230, 3.4 = 3310, 3.5 = 3350 (3351 from 3.5.2), 3.6 = 3379, 3.7 = 3394, 3.8 = 3413, 3.9 = 3425, 3.10 = 3439, 3.11 = 3495, 3.12 = 3531, 3.13 = 3571, 3.14 = 3627, 3.15 = 3666." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:PYC (Python compiled bytecode)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "pyc_magic" |
|---|
| underlying_type | "uint16_t" |
|---|
| values | | PYC_MAGIC_2_7 | 62211 |
|---|
| PYC_MAGIC_3_0 | 3131 |
|---|
| PYC_MAGIC_3_1 | 3151 |
|---|
| PYC_MAGIC_3_2 | 3180 |
|---|
| PYC_MAGIC_3_3 | 3230 |
|---|
| PYC_MAGIC_3_4 | 3310 |
|---|
| PYC_MAGIC_3_5 | 3350 |
|---|
| PYC_MAGIC_3_5_2 | 3351 |
|---|
| PYC_MAGIC_3_6 | 3379 |
|---|
| PYC_MAGIC_3_7 | 3394 |
|---|
| PYC_MAGIC_3_8 | 3413 |
|---|
| PYC_MAGIC_3_9 | 3425 |
|---|
| PYC_MAGIC_3_10 | 3439 |
|---|
| PYC_MAGIC_3_11 | 3495 |
|---|
| PYC_MAGIC_3_12 | 3531 |
|---|
| PYC_MAGIC_3_13 | 3571 |
|---|
| PYC_MAGIC_3_14 | 3627 |
|---|
| PYC_MAGIC_3_15 | 3666 |
|---|
|
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "Known values list; last entry per minor version at lines 61 (62211), 104 (3351), 118 (3379), 123 (3394), 132 (3413), 138 (3425), 148 (3439), 200 (3495), 232 (3531), 254 (3571), 282 (3627), 299 (3666)" |
|---|
| repo | "https://github.com/python/cpython" |
|---|
| commit | "010bebbf9fd12bba1e3f40bdbddacd51a9c2bf20" |
|---|
| path | "Include/internal/pycore_magic_number.h" |
|---|
| lines | "28-299" |
|---|
|
| type | "source" |
|---|
| detail | "3.13 branch: MAGIC_NUMBER = (3571).to_bytes(2, 'little') + b'\r\n'" |
|---|
| repo | "https://github.com/python/cpython" |
|---|
| commit | "24d048d3601c2f1d41fa357897c1c91bb0a0bc13" |
|---|
| path | "Lib/importlib/_bootstrap_external.py" |
|---|
| lines | "492" |
|---|
|
| type | "source" |
|---|
| detail | "3.14 branch (3.14.8+): #define PYC_MAGIC_NUMBER 3627" |
|---|
| repo | "https://github.com/python/cpython" |
|---|
| commit | "b643e2f531f86d9afada130a36803e3bb025b5be" |
|---|
| path | "Include/internal/pycore_magic_number.h" |
|---|
| lines | "295" |
|---|
|
| type | "source" |
|---|
| detail | "3.15 branch (3.15.0 final): #define PYC_MAGIC_NUMBER 3666" |
|---|
| repo | "https://github.com/python/cpython" |
|---|
| commit | "a73827e5bc4bb993504d5384071a8c734b36e2ea" |
|---|
| path | "Include/internal/pycore_magic_number.h" |
|---|
| lines | "313" |
|---|
|
| type | "runtime_test" |
|---|
| detail | "3.11.15 writes 3495 and 3.12.8 writes 3531" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Magic numbers of final releases" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T05:12:29.071Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T11:30:12.713Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read pycore_magic_number.h at 010bebbf: last entry per minor version matches (3.0b1 3131, 3.1 3151, 3.2 3180, 3.3 3230, 3.4 3310, 3.5 3350/3351, 3.6 3379, 3.7 3394, 3.8 3413, 3.9 3425, 3.10 3439, 3.11 3495, 3.12 3531, 3.13 3571, 3.14 3627, 3.15 3666). The file already lists 3.16 (3700-3706), so the fact is a per-minor summary." |
|---|
|
|
|---|