Tal Einat added the comment:
I couldn't reproduce this on the latest main branch with an updated version of
the code sample (see attached repro.py). I also couldn't get such a crash with
some variations of this.
I'm marking this as fixed for now. We can re-open this if anyone runs into an
u
Terry J. Reedy added the comment:
In Py3, new.code and new.function become types.CodeType and types.FunctionType.
The 'documentation' of their signatures is only available with help(types.xxx).
So the library doc issue is 2.7 only.
Running with IDLE, 3.3b0, Win7, the converted example does cr
Jeffrey Harper added the comment:
Martin,
Thanks for your response. I didn't know it was possible to pass freevars and
cellvars to new.code. I think the documentation needs to be updated. The
documentation for 2.7.3 located at
http://docs.python.org/library/new.html?highlight=new#new.code
Martin v. Löwis added the comment:
You need to pass co_freevars and co_cellvars as well for your example to work.
It shouldn't crash, but I don't consider this particular crash as a bug, as it
is a known limitation that new.code doesn't perform all consistency checks that
are necessary to gua
Jeffrey Harper added the comment:
The marshal loads and dumps don't seem to be necessary to reproduce the crash.
On both the Windows Vista and Ubuntu Linux systems, the crash still occurred
when I replaced:
mcopy_code = loads(dumps(code))
with:
mcopy_code = code #loads(dumps(code))
--
New submission from Jeffrey Harper :
I've attached a script that crashes the Python interpreter.
I can get the crash to occur under Windows Vista with this version of Python:
C:\tmp\remote>c:\Python27\python.exe
Python 2.7.1 Stackless 3.1b3 060516 (release27-maint, Jan 1 2011, 13:04:37)
[MS