[Python-Dev] Re: 2.1a2 release issues; mail.python.org still down

Fred L. Drake, Jr. fdrake@acm.org
Thu, 1 Feb 2001 12:08:49 -0500 (EST)


[Pushing this to python-dev w/out M-A's permission, now that mail is
 starting to flow again.]

M.-A. Lemburg writes:
 > Another issue: importing old extensions now causes a core dump
 > due to the new slots for weak refs beind written to.

  I think(!) this should only affect really modules from 1.5.? and
earlier; type objects compiled after tp_xxx7/tp_xxx8 were added
*should not* have a problem with this.  You don't give enough
information for me to be sure.  Please let me know more if I'm wrong
(possible!).
  The only way I can see that there would be a problem like this is if
the type object contains a positive value for the tp_weaklistoffset
field (formerly tp_xxx8).

 > Solution: in addition to printing a warning, the _PyModule_Init()
 > APIs should ignore all modules having an API level < 1010.

  For the specific problem you mention, we could add a type flag
(Py_TPFLAGS_HAVE_WEAKREFS) that could be tested; it would be set in
Py_TPFLAGS_DEFAULT.
  On the other hand, I'd be perfectly happy to "ignore" modules with
the older C API version (especially if "ignore" lets me call
Py_FatalError()!).  The API version changed because of the changes to
the function signatures of PyCode_New() and PyFrame_New(); these both
require additional parameters in API version 1010.


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Digital Creations