PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 696 - Python 2.7 will crash if passing non existing self.var to QMenu constructor.
: Python 2.7 will crash if passing non existing self.var to QMenu constructor.
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: QtGui
: 1.0.0 rc1
: PC MS Windows XP/Vista/7
: P2 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2011-02-22 11:41 EET by reimund
Modified: 2011-04-01 23:15 EEST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description reimund 2011-02-22 11:41:16 EET
Hi,

the following code will crash python (2.7?) while calling QMenu constructor.
But only if super()(QtGui.QMainWindow.__init__(self)) isn't called before.

# Python Version:
Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)]

# Code
import sys
from PySide import QtGui, QtCore

def main():
    app = QtGui.QApplication(sys.argv)
    w = MainWindow()
    w.show()
    sys.exit(app.exec_())


class MainWindow(QtGui.QMainWindow):
    def __init__(self, *args):
        #QtGui.QMainWindow.__init__(self)
        self._menu = QtGui.QMenu(self.dontexist)

if __name__ == "__main__":
    sys.exit(main())
# End Code

thanks for your work!
Comment 1 Hugo Parente Lima 2011-02-22 15:22:05 EET
Prioritizing as P2, a fix will be shipped probably only on 1.1/1.0.1/whatever
due to our release policy in RC times.

Thanks for reporting.
Comment 2 renato filho 2011-03-16 22:09:06 EET
fixed on shiboken commit:

commit fd7a697778c16df3b2376b2d603845baa0f4bd8e
Author: Renato Filho <renato.filho@openbossa.org>
Date:   Tue Mar 15 15:32:13 2011 -0300

and pyside commit:

commit 880e6a28b6336ebe77bd3369b65c32ab8b01b95f
Author: Renato Filho <renato.filho@openbossa.org>
Date:   Tue Mar 15 15:33:30 2011 -0300
Comment 3 Hugo Parente Lima 2011-04-01 23:15:56 EEST
Closing bug after release of PySide 1.0.1.