[Python-Dev] Linker problems on Linux

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Sun, 16 Jul 2000 22:57:47 +0200


>> Why hasn't anyone objected to simply dropping such an important
>> API without proper backwards compatibility workaround ?

> If I knew it was happening, I would have whined.  And I expect Guido
> would have screamed.

Although I ran into this as well, I don't think it is as bad as it
sounds. The API has not been changed; only modules compiled for 1.5
(*) won't run in current CVS python - you have to recompile.

Even if you restore the PySequence_Length as a Python entry point, you
still get a warning that the ABI version mismatches. I haven't
thoroughly checked, yet, but I believe that there is no way that
Python 2 can guarantee binary compatibility for all 1.5.x modules.

For example, if you have a 1.5.2-compiled type in an extension module,
and that type happens to implement PySequenceMethods, then applying 'a
in b' will likely crash: Python 2 will check for the sq_contains
field, but that is past the end of the function table in the old
module.

So I think it is actually a good thing if an important ABI is not
supported anymore. Instead of getting random crashes, you get an error
on import. I wish there was a better way to gracefully fail when
importing 1.5 modules on Windows. The approach of calling the entry
not 'initxxx' but 'init2xxx' would work, but is quite inconvenient.

Regards,
Martin

(*) modules compiled with last week's CVS python won't work, either,
but if you have any of these, you know how to recompile things :-)