A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-February/012568.html below:

[Python-Dev] Identifying magic prefix on Python files?

[Python-Dev] Identifying magic prefix on Python files? [Python-Dev] Identifying magic prefix on Python files?Guido van Rossum guido@digicool.com
Sun, 04 Feb 2001 16:02:22 -0500
> Python's .pyc files don't have a magic prefix that the file(1) utility
> can recognize.  Would anyone object if I fixed this?  A trivial pair of
> hacks to the compiler and interpreter would do it.  Backward compatibility
> would be easily arranged.

I don't understand.  The .pyc file has a magic number.  Why is this
incompatible with file(1)?

> Embedding the Python version number in the prefix might enable some
> useful behavior down the road.

If we're going to redesign the .pyc file header, I'd propose the
following:

(1) magic number -- for file(1), never to be changed

(2) some kind of version -- Python version, or API version, or
    bytecode version

(3) mtime of .py file

(4) options, e.g. is this a .pyc or a .pyo

(5) size of marshalled code following

(6) marshalled code

--Guido van Rossum (home page: http://www.python.org/~guido/)




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4