[Python-Dev] Compatibility between Python 2.3.x and Python 2.4.x

Neal Norwitz nnorwitz at gmail.com
Thu Sep 15 23:42:54 CEST 2005

On 9/15/05, Rich Burridge <Rich.Burridge at sun.com> wrote:
> Hi,
> I'm involved with the team that's working towards installing Python 2.4.x
> as part of a future release of the Solaris O/S.

Cool.  I would like to hear more about what you are doing.

> We currently have Python 2.3.x installed. We are trying to determine just
> how compatible these two release are (at both the binary and source levels).
> In other words, with Python 2.3.x .py, .pyc and .pyo files work correctly
> with Python 2.4.x ?

The binary versions (.pyc and .pyo) are not compatible, their magic
number is different.  I don't know the details, but if you want to
investigate yourself.  Get a CVS version, cd python/dist/src ; cvs
diff -r r23 -r r24 Python/import.c

That shows the magic number changing.  You will need to read CVS logs
to figure out why.  It's possible the numbers don't really *need* to
change.  I see two comments in the logs are:

* Bump the magic number to avoid sharing bytecode between 2.3 and 2.4.
Revise the long comment that explained details of the magic number
in gory detail.

* With Guido's okay, bumped up the magic number so that this patch gets
  widely exercised before the alpha goes out.

There are other patches which may have bumped the magic number for
other reasons.

> Can somebody point me at this information please?

BTW, this list probably isn't the best place to post this question. 
comp.lang.python (python-list at python.org) is generally preferred for
details about implementation.

If you are really interested in finding out more about Python, perhaps
you can come to the BayPIGGIES (Python Users Group) meeting at Google
tonight (7.30pm) in Mt. View.  Contact me off-list if you want more


More information about the Python-Dev mailing list