SubProcessDialog doesn't work with PyQt 4.5

Bug #394125 reported by methane
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
QBzr
Fix Released
High
methane

Bug Description

SubProcessDialog does:
  self.connect(self.buttonbox, QtCore.SIGNAL("accepted()"), self.accept)

But self.accpet is defferent in PyQt4.4 and PyQt 4.5

I reported here: https://answers.launchpad.net/qbzr/+question/75757
---
In PyQt 4.4, QBzrInitWindow.accept is SubProcessWindowBase.accept.
In PyQt 4.5, QBzrInitWindow.accept is QtGui.QDialog.accept.

Inheritance relationship is:

  class QBzrDialog(QtGui.QDialog, _QBzrWindowBase)
  +-class SubProcessDialog(QBzrDialog, SubProcessWindowBase)
      +-class QBzrInitWindow(SubProcessDialog)

So, PyQt 4.5's behavior is natural mro (method resolution order).

I think the SubProcessWindowBase should avoid name used in (QDialog, QObject, QWidget, etc...)

Revision history for this message
methane (songofacandy) wrote :

SubProcessWindowBase.accept seems not be overridden.
So I tried making accept() private.
Then qinit makes repository correctly, but below error happened.
How I can get callstack?

Error report dialog:
bzr: ERROR: exceptions.TypeError: native Qt signal is not callable

TypeError: native Qt signal is not callable

bzr 1.16.1 on python 2.6.2 (win32)
arguments: ['C:\\usr\\Python2.6\\Scripts\\bzr', 'qinit']
encoding: 'cp932', fsenc: 'mbcs', lang: None
plugins:
  explorer C:\usr\Python2.6\lib\site-packages\bzrlib\plugins\explorer [0.1dev]
  launchpad C:\usr\Python2.6\lib\site-packages\bzrlib\plugins\launchpad [1.16.1]
  netrc_credential_store C:\usr\Python2.6\lib\site-packages\bzrlib\plugins\netrc_credential_store [1.16.1]
  qbzr C:\usr\Python2.6\lib\site-packages\bzrlib\plugins\qbzr [0.12dev]
  stats C:\usr\Python2.6\lib\site-packages\bzrlib\plugins\stats [unknown]
  xmloutput C:\Documents and Settings\inada-n\Application Data\bazaar\2.0\plugins\xmloutput [0.8.4]

qbzr.log:
水 2009-07-01 14:36:23 +0900
0.188 bzr arguments: [u'qinit']
0.203 looking for plugins in C:/Documents and Settings/inada-n/Application Data/bazaar/2.0/plugins
0.375 looking for plugins in C:\usr\Python2.6\lib\site-packages\bzrlib\plugins
0.469 encoding stdout as sys.stdout encoding 'cp932'
2.203 encoding stdout as sys.stdout encoding 'cp932'

水 2009-07-01 14:36:25 +0900
0.188 bzr arguments: [u'qsubprocess', u'"init" "--format=default" "C:\\home\\\u65b0\u3057\u3044\u30d5\u30a9\u30eb\u30c0"']
0.219 looking for plugins in C:/Documents and Settings/inada-n/Application Data/bazaar/2.0/plugins
0.375 looking for plugins in C:\usr\Python2.6\lib\site-packages\bzrlib\plugins
0.485 encoding stdout as osutils.get_user_encoding() 'cp932'
0.610 bzr arguments: [u'init', u'--format=default', u'C:\\home\\\u65b0\u3057\u3044\u30d5\u30a9\u30eb\u30c0']
0.641 encoding stdout as osutils.get_user_encoding() 'cp932'
0.656 creating repository in file:///C:/home/%E6%96%B0%E3%81%97%E3%81%84%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80/.bzr/.
0.688 creating branch <bzrlib.branch.BzrBranchFormat6 object at 0x017272F0> in file:///C:/home/%E6%96%B0%E3%81%97%E3%81%84%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80/.bzr/
0.719 trying to create missing lock 'C:/home/\xe6\x96\xb0\xe3\x81\x97\xe3\x81\x84\xe3\x83\x95\xe3\x82\xa9\xe3\x83\xab\xe3\x83\x80/.bzr/checkout/dirstate'
0.719 opening working tree 'C:/home/\xe6\x96\xb0\xe3\x81\x97\xe3\x81\x84\xe3\x83\x95\xe3\x82\xa9\xe3\x83\xab\xe3\x83\x80'
0.766 opening working tree 'C:/home/\xe6\x96\xb0\xe3\x81\x97\xe3\x81\x84\xe3\x83\x95\xe3\x82\xa9\xe3\x83\xab\xe3\x83\x80'
0.828 return code 0
3.266 None

21.470 return code 0

Revision history for this message
methane (songofacandy) wrote :

I can manage to qinit works with this patch.

Revision history for this message
methane (songofacandy) wrote :

Previous patch is incompleted.
Attached is remaked.

Revision history for this message
Alexander Belchenko (bialix) wrote :

Naoki, thank you for such detailed report. I'm planning to install Py2.6+PyQt4.5 on my computer to work on this problem soon.

Changed in qbzr:
importance: Undecided → High
milestone: none → 0.12
status: New → Confirmed
Revision history for this message
methane (songofacandy) wrote : Re: [Bug 394125] Re: SubProcessDialog doesn't work with PyQt 4.5

There are many conflicts. My patch is far from complete.

I'll make a branch and manage to resolve conflicts in below process.

1. rename method definitions.
  s/def close/def _close/
  s/def reject/def _reject/
  s/def accept/def _accept/
  s/def failed/def _failed/
  s/def finished/def _finished/

2. rename method calls conflicting against signals. (failed, finished)
  s/self.failed(/self._failed/
  s/self.finished(/self._finished/

3. resolve conflict between method and slots. (close, reject, accept)
This is difficult for me because I don't know "self.close()" is
calling Python method
or QWidget.close() slot.
I have idea that resolve it.

3.1 define fallback.
class _QBzrWindowBase:
    def _close(self): self.close()
    def _reject(self): self.reject()
    def _accept(self): self.accept()

3.2 rename all method calls

--
Naoki INADA <email address hidden>

Revision history for this message
Alexander Belchenko (bialix) wrote :

Naoki, I think it's better to rename methods using "do_" prefix, e.g.
do_accept, do_close, etc.

Leading underscore usually means private method in Python.

Revision history for this message
methane (songofacandy) wrote :

I make branch lp:~songofacandy/qbzr/qt45support -r800.. (Please ignore r799. It is already applied to trunk)
I check some commands and it looks good on both Python2.5+PyQt4.4 and Python2.6+PyQt4.5.

But I think more testing and reviewing is neeeded to released as official bzr release.
Please try it, someone.

Changed in qbzr:
milestone: 0.12 → 0.13
Changed in qbzr:
assignee: nobody → INADA Naoki (songofacandy)
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.