Crash in qconflicts when there is conflict in non-versioned file (TypeError: argument 1 of PyQt4.QtCore.QVariant() has an invalid type)

Bug #655451 reported by Philip Peitsch
112
This bug affects 18 people
Affects Status Importance Assigned to Milestone
QBzr
Status tracked in Trunk
0.19
Fix Released
Critical
Alexander Belchenko
0.20
Fix Released
Critical
Alexander Belchenko
Trunk
Fix Released
Critical
Alexander Belchenko

Bug Description

A conflict that occurs when attempting to remove a non-empty folder with no versioned children causes the qconflicts dialog to crash. I did check this with 1.1.1 and found it was still occurring.

To reproduce this bug, perform the following steps:

mkdir repo
cd repo

mkdir co1
pushd co1
bzr init
mkdir empty
bzr add
bzr commit -m "Added empty folder"
popd

bzr branch co1 co2

pushd co1
bzr rm empty
bzr commit -m "Removed empty folder"
popd

pushd co2
pushd empty
echo hi > something.txt
popd
bzr merge ../co1
bzr qconflicts # Crashes at this point
popd

Stack trace is:
bzr: ERROR: exceptions.TypeError: argument 1 of PyQt4.QtCore.QVariant() has an invalid type

Traceback (most recent call last):
  File "C:/Program Files/Bazaar/plugins\qbzr\lib\conflicts.py", line 171, in load
TypeError: argument 1 of PyQt4.QtCore.QVariant() has an invalid type

bzr 2.2.1 on python 2.6.4 (win32)
arguments: ['bzr', 'qconflicts']
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
  bzrtools C:\Program Files\Bazaar\plugins\bzrtools [2.2.0]
  colo C:\Program Files\Bazaar\plugins\colo [0.1.0]
  directory_aliases C:\Source\Bazaar\bzr\directory_aliases [2.2.1]
  explorer C:\Program Files\Bazaar\plugins\explorer [1.1.1]
  fastimport C:\Program Files\Bazaar\plugins\fastimport [0.9.0dev]
  launchpad C:\Program Files\Bazaar\plugins\launchpad [2.2.1]
  loom C:\Program Files\Bazaar\plugins\loom [2.2.1dev]
  netrc_credential_store C:\Program Files\Bazaar\plugins\netrc_credential_store [2.2.1]
  news_merge C:\Program Files\Bazaar\plugins\news_merge [2.2.1]
  pipeline C:\Program Files\Bazaar\plugins\pipeline [unknown]
  qbzr C:\Program Files\Bazaar\plugins\qbzr [0.19.2]
  rewrite C:\Program Files\Bazaar\plugins\rewrite [0.6.1]
  svn C:\Program Files\Bazaar\plugins\svn [1.0.4]
  upload C:\Program Files\Bazaar\plugins\upload [1.0.0dev]
  xmloutput C:\Program Files\Bazaar\plugins\xmloutput [0.8.6]

Related branches

Revision history for this message
Nicholas Kazouris (nkazouris) wrote :

This happens because conflict.file_id in file conflicts.py line 171 is None. If this line is changed to:

item.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(conflict.file_id or ''))

this exception is not thrown, the QConflict dialog opens and the conflict can be resolved. Unfortunately, I don't know what other side effects this change may have, since I don't know Python yet :) or QBzr internals.

Tested with QBzr 0.19.3 and bzrlib 2.2.1

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

Thank you for your report and analysis. I'll fix it.

Changed in qbzr:
assignee: nobody → Alexander Belchenko (bialix)
importance: Undecided → High
milestone: none → 0.21b1
status: New → In Progress
Changed in qbzr:
status: In Progress → Fix Released
Revision history for this message
Alexander Belchenko (bialix) wrote :

Due the big amount of duplicates the bugfix should be ported to all supported series.

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

It seems this bug has very old roots.

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

But maybe old Qt/PyQt was more tolerant to attempts of storing None in QVariant.

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

I haven't seen any duplicate bug report mentioned qbzr 0.18.x. So I don't plan to apply the patch to that series. If you really need it fixed I'll be able to do so, please say so.

summary: - Crash in qconflicts when conflict is attempting to delete non-empty
- directory
+ Crash in qconflicts when there is conflict in non-versioned file
summary: Crash in qconflicts when there is conflict in non-versioned file
+ (TypeError: argument 1 of PyQt4.QtCore.QVariant() has an invalid type)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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