Crash in qconflicts when there is conflict in non-versioned file (TypeError: argument 1 of PyQt4.QtCore.QVariant() has an invalid type)
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.
Traceback (most recent call last):
File "C:/Program Files/Bazaar/
TypeError: argument 1 of PyQt4.QtCore.
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\
colo C:\Program Files\Bazaar\
directory_aliases C:\Source\
explorer C:\Program Files\Bazaar\
fastimport C:\Program Files\Bazaar\
launchpad C:\Program Files\Bazaar\
loom C:\Program Files\Bazaar\
netrc_
news_merge C:\Program Files\Bazaar\
pipeline C:\Program Files\Bazaar\
qbzr C:\Program Files\Bazaar\
rewrite C:\Program Files\Bazaar\
svn C:\Program Files\Bazaar\
upload C:\Program Files\Bazaar\
xmloutput C:\Program Files\Bazaar\
Changed in qbzr: | |
status: | In Progress → Fix Released |
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) |
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