[issue15251] new.code and new.function crashes Python iterpretter

2021-10-18 Thread Tal Einat
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

[issue15251] new.code and new.function crashes Python iterpretter

2012-07-06 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu 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

[issue15251] new.code and new.function crashes Python iterpretter

2012-07-04 Thread Jeffrey Harper
New submission from Jeffrey Harper jeff1.61...@gmail.com: 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\remotec:\Python27\python.exe Python 2.7.1 Stackless 3.1b3 060516 (release27-maint, Jan 1

[issue15251] new.code and new.function crashes Python iterpretter

2012-07-04 Thread Jeffrey Harper
Jeffrey Harper jeff1.61...@gmail.com 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

[issue15251] new.code and new.function crashes Python iterpretter

2012-07-04 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de 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

[issue15251] new.code and new.function crashes Python iterpretter

2012-07-04 Thread Jeffrey Harper
Jeffrey Harper jeff1.61...@gmail.com 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