[issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell

2017-12-03 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks for the issue report! The fix will be released in 3.6.4 and 3.7.0a3 (both of which are expected to be later this month). -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7

[issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell

2017-12-03 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset c8f32aae0aa173e122cf4c0592caec620d0d1de9 by Nick Coghlan in branch '3.6': [3.6] bpo-32176: Set CO_NOFREE in the code object constructor (GH-4684) https://github.com/python/cpython/commit/c8f32aae0aa173e122cf4c0592caec620d0d1de9

[issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell

2017-12-02 Thread Nick Coghlan
Change by Nick Coghlan : -- pull_requests: +4597 ___ Python tracker ___ ___

[issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell

2017-12-02 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 078f1814f1a4413a2a0fdb8cf4490ee0fc98ef34 by Nick Coghlan in branch 'master': bpo-32176: Set CO_NOFREE in the code object constructor (GH-4675) https://github.com/python/cpython/commit/078f1814f1a4413a2a0fdb8cf4490ee0fc98ef34

[issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell

2017-12-02 Thread Nick Coghlan
Change by Nick Coghlan : -- keywords: +patch pull_requests: +4583 stage: -> patch review ___ Python tracker ___

[issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell

2017-12-01 Thread Nick Coghlan
Nick Coghlan added the comment: Given that, I'd say the way to cleanest way to fix this would be to remove these lines from "compute_code_flags" in compile.c: if (!PyDict_GET_SIZE(c->u->u_freevars) && !PyDict_GET_SIZE(c->u->u_cellvars)) { flags |=

[issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell

2017-12-01 Thread Dan Snider
Dan Snider added the comment: So while CO_NOFREE is set in all versions with the example code, it appears only python 3.6 recognizes that flag and disallows the accessing of the __class__ cell. In this case the error message is bad because it implies that the

[issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell

2017-11-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +ncoghlan ___ Python tracker ___ ___

[issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell

2017-11-30 Thread Dan Snider
Dan Snider added the comment: The hacked cell object using this method appears to be changed to NULL when accessed by frame.f_localsplus. I don't know C well enough to find out what's happening because nothing looks different to me in PyFrame_FastToLocalsWithError.

[issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell

2017-11-29 Thread Dan Snider
New submission from Dan Snider : The following code works in 3.3, 3.4, and 3.5, but in 3.6 it throws RuntimeError: super(): bad __class__ cell. from types import FunctionType, CodeType def create_closure(__class__): return (lambda: __class__).__closure__ def