Ran into the following traceback while importing a CSV file:
Application Name: moneyGuru
Traceback (most recent call last):
File "/home/nelson/projects/moneyguru/qt/controller/main_window.py", line 629, in importDocument
File "/home/nelson/projects/moneyguru/core/gui/main_window.py", line 479, in parse_file_for_import
File "/home/nelson/projects/moneyguru/core/gui/csv_options.py", line 211, in show
File "/home/nelson/projects/moneyguru/core/gui/csv_options.py", line 118, in _refresh_columns
File "/home/nelson/projects/moneyguru/qt/controller/import_/csv_options.py", line 153, in refresh_columns
AttributeError: 'CSVOptionsTableModel' object has no attribute 'reset'
It turns out QAbstractItemModel (and it's inheritance chain) no longer supports the deprecated reset method in PyQt5. At a minimum, the following re-definition of the reset method is necessary in QAbstractItemModel subclasses for PyQt5.
# [... other methods / members ...]
# unnecessary call to actually clear data, but recommended by design guidance from Qt docs
# left blank in preliminary testing
Will try to submit a PR against this ticket.
Obviously, this is against the master and not maintenance branch. I should have mentioned that.
Thanks for the catch. I had made the same fix during the Qt5 transition of dupeGuru, but it seems that I forgot about it this time. I didn't bother redefining reset(). I simply replaced the reset call by these two calls. Example at https://github.com/hsoft/dupeguru/blob/43974f9ebdcca8cc0dcabceafe385069ee85ffe4/qt/base/details_dialog.py#L44
qt: fix crash on CSV import