Skip to content

DataTreeWidget: dict sorting crashfix#1419

Merged
j9ac9k merged 1 commit intopyqtgraph:masterfrom
iam-git:DataTreeWidget_crash_fix_PR
Oct 24, 2020
Merged

DataTreeWidget: dict sorting crashfix#1419
j9ac9k merged 1 commit intopyqtgraph:masterfrom
iam-git:DataTreeWidget_crash_fix_PR

Conversation

@iam-git
Copy link
Copy Markdown
Contributor

@iam-git iam-git commented Oct 24, 2020

Solves issue when DataTreeWidget crashes if some dictionary contains both ints and tuples (yeah, I have such weird stuff). Sorting falls and then it looks like this:

File "/packages/python3-3.7.7-2/.self/non-packaged/lib/python3.7/site-packages/pyqtgraph/widgets/DataTreeWidget.py", line 25, in __init__ self.setData(data) File "/packages/python3-3.7.7-2/.self/non-packaged/lib/python3.7/site-packages/pyqtgraph/widgets/DataTreeWidget.py", line 35, in setData self.buildTree(data, self.invisibleRootItem(), hideRoot=hideRoot) File "/packages/python3-3.7.7-2/.self/non-packaged/lib/python3.7/site-packages/pyqtgraph/widgets/DataTreeWidget.py", line 72, in buildTree self.buildTree(data, node, asUnicode(key), path=path+(key,)) File "/packages/python3-3.7.7-2/.self/non-packaged/lib/python3.7/site-packages/pyqtgraph/widgets/DataTreeWidget.py", line 72, in buildTree self.buildTree(data, node, asUnicode(key), path=path+(key,)) File "/packages/python3-3.7.7-2/.self/non-packaged/lib/python3.7/site-packages/pyqtgraph/widgets/DataTreeWidget.py", line 50, in buildTree typeStr, desc, childs, widget = self.parse(data) File "/packages/python3-3.7.7-2/.self/non-packaged/lib/python3.7/site-packages/pyqtgraph/widgets/DataTreeWidget.py", line 96, in parse childs = OrderedDict(sorted(data.items())) TypeError: '<' not supported between instances of 'tuple' and 'int'

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Oct 24, 2020

Thanks for the PR, LGTM, merging!

@j9ac9k j9ac9k merged commit 451075b into pyqtgraph:master Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants