Issue2101

classification
Title: Diamond-style multiple inheritance fails when using __slots__ on the second branch
Type: crash Severity: normal
Components: Core Versions: Jython 2.7
Milestone: Jython 2.7.1
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: stefan.richthofer Nosy List: cdleonard, fwierzbicki, jeff.allen, stefan.richthofer, zyasoft
Priority: normal Keywords:

Created on 2013-10-29.18:43:07 by cdleonard, last changed 2017-03-28.05:29:11 by zyasoft.

Messages
msg8164 (view) Author: Leonard Crestez (cdleonard) Date: 2013-10-29.18:43:06
First the sample code (ugly formatting for brevity):

class A(object):
    def method(self): pass

class B(A):
    __slots__ = ('b')
    def method(self):
        sys.stdout.write('B.method begin\n')
        super(B, self).method()
        self.b = 'b'

class C(A):
    def method(self):
        sys.stdout.write('C.method begin\n')
        super(C, self).method()
        self.c = 'c'

class D1(B, C):
    def method(self): super(D1, self).method()

class D2(C, B):
    def method(self): super(D2, self).method()

D1().method()
D2().method()

This works as expected in python. Output is the following:
B.method begin
C.method begin
C.method begin
B.method begin

On jython I get an exception when assigning to self.b under D2.method:
B.method begin
C.method begin
C.method begin
B.method begin
Traceback (most recent call last):
  File "jymulti.py", line 28, in <module>
    D2().method()
  File "jymulti.py", line 25, in method
    def method(self): super(D2, self).method()
  File "jymulti.py", line 18, in method
    super(C, self).method()
  File "jymulti.py", line 13, in method
    self.b = 'b'
java.lang.ArrayIndexOutOfBoundsException: 0
msg8172 (view) Author: Jeff Allen (jeff.allen) Date: 2013-11-01.23:57:37
#1996 likely same bug.
msg9081 (view) Author: Jim Baker (zyasoft) Date: 2014-10-05.17:16:18
Straightforward test for a complex problem
msg9082 (view) Author: Jim Baker (zyasoft) Date: 2014-10-05.17:16:44
Need to investigate for beta 4
msg9928 (view) Author: Jim Baker (zyasoft) Date: 2015-04-23.03:55:10
Related to #1996
msg11158 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2017-03-03.09:42:13
Fixed as of https://hg.python.org/jython/rev/4884658aa644.
History
Date User Action Args
2017-03-28 05:29:11zyasoftsetstatus: pending -> closed
2017-03-03 09:42:14stefan.richthofersetstatus: open -> pending
type: crash
nosy: + stefan.richthofer
messages: + msg11158
assignee: stefan.richthofer
milestone: Jython 2.7.2 -> Jython 2.7.1
resolution: remind -> fixed
2015-12-29 23:55:18zyasoftsetmilestone: Jython 2.7.1 -> Jython 2.7.2
2015-04-23 03:55:10zyasoftsetmessages: + msg9928
2015-04-23 03:54:11zyasoftsetmilestone: Jython 2.7.1
2014-10-05 17:16:44zyasoftsetpriority: normal
messages: + msg9082
2014-10-05 17:16:18zyasoftsetresolution: remind
messages: + msg9081
nosy: + zyasoft
2013-11-01 23:57:37jeff.allensetnosy: + jeff.allen
messages: + msg8172
2013-10-29 20:06:00fwierzbickisetnosy: + fwierzbicki
2013-10-29 18:43:07cdleonardcreate