[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-27 Thread Nick Coghlan
Change by Nick Coghlan : -- stage: backport needed -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mai

[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-27 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 084f80b82c564c8a3cef26fc6e56da188a379be2 by Nick Coghlan (Miss Islington (bot)) in branch '3.6': [3.6] bpo-31588: Validate return value of __prepare__() methods (GH-3790) https://github.com/python/cpython/commit/084f80b82c564c8a3cef26fc6e56da188a37

[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-27 Thread Nick Coghlan
Nick Coghlan added the comment: CI is still running for the backport, so I'll merge that tomorrow. Thanks for the patch! -- resolution: -> fixed stage: patch review -> backport needed ___ Python tracker ___

[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-27 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +3776 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-27 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 5837d0418f47933b2e3c139bdee8a79c248a943c by Nick Coghlan (Oren Milman) in branch 'master': bpo-31588: Validate return value of __prepare__() methods (GH-3764) https://github.com/python/cpython/commit/5837d0418f47933b2e3c139bdee8a79c248a943c -

[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-27 Thread Nick Coghlan
Nick Coghlan added the comment: Aye, that's exactly what I did. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-27 Thread Oren Milman
Oren Milman added the comment: Nick, maybe you tried to reproduce in release? In debug (where I got the SystemError), you have in the beginning of _PyFrame_New_NoTrack(): #ifdef Py_DEBUG if (code == NULL || globals == NULL || !PyDict_Check(globals) || (locals != NULL && !PyMapping_C

[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-27 Thread Nick Coghlan
Nick Coghlan added the comment: There's no __prepare__ method in 2.7, so that version can't be affected by this. For 3.6 and 3.7, I can't reproduce the reported SystemError. Instead, I get: ``` >>> class BadMetaclass(type): ... def __prepare__(*args): ... pass ... >>> class Foo(me

[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm not a metaclass expert. Eric, Nick, could you please take a look at the patch? -- versions: +Python 2.7, Python 3.6 ___ Python tracker

[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +eric.snow, ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-26 Thread Oren Milman
Changes by Oren Milman : -- keywords: +patch pull_requests: +3749 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-26 Thread Oren Milman
New submission from Oren Milman: The following code causes a SystemError: class BadMetaclass(type): def __prepare__(*args): pass class Foo(metaclass=BadMetaclass): pass This is because builtin___build_class__() assumes that __prepare__() returned a mapping, and passes it to PyE