Riverscapes / QRAVEPlugin

QGIS Plugin for viewing Riverscapes projects
GNU General Public License v3.0
0 stars 0 forks source link

Python error in QGIS #71

Closed joewheaton closed 5 months ago

joewheaton commented 2 years ago

I'm seeing this in 0.7 of QRAVE in QGIS:

2022-05-25T13:27:43 WARNING Python error : An error has occurred while executing Python code: See message log (Python Error) for more details.

If you go to the Python Errors, this is what it says:

2022-05-14T11:39:57 WARNING Traceback (most recent call last): File "C:\Users/a00687426/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qrave_toolbar\src\qrave_toolbar.py", line 355, in projectBrowserDlg self.dockwidget.add_project(dialog_return[0]) AttributeError: 'NoneType' object has no attribute 'add_project'

2022-05-14T12:51:37 WARNING Traceback (most recent call last): File "C:\Users/a00687426/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qrave_toolbar\src\qrave_toolbar.py", line 355, in projectBrowserDlg self.dockwidget.add_project(dialog_return[0]) AttributeError: 'NoneType' object has no attribute 'add_project'

2022-05-25T13:27:43 WARNING Traceback (most recent call last): File "C:\Users/a00687426/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qrave_toolbar\src\dock_widget.py", line 423, in close_all self.close_project(self.loaded_projects[0]) IndexError: list index out of range

Annoyingly, it is not every time every time I open QGIS. I will pay more attention to what seems to be the trigger. I have seen this on multiple machines. It might be that it is associated with when I open an existing *.qgz and it was saved with layers added from QRAVE, and then I try to reopen that QGZ file, then close it and start a new map (without quitting QGIS), that triggers it? Not sure., @MattReimer or @KellyMWhitehead any thoughts?

philipbaileynar commented 2 years ago

My suspicion is that this is related to loading QGZ files that attempt to load QRAVE projects. So I tried the following:

Test 1

  1. New, blank QGIS session.
  2. Open QRAVE Project.
  3. Add Multiple layers to the map.
  4. Save QGZ File.
  5. Close QGIS.
  6. Open QGIS.
  7. Load QGZ file created above.

No problems encountered.

Test 2

Same as test 1. But inbetween step 5 and 6 I moved the QRAVE project on disk so it couldn't be found. I was unable to reproduce the error reported. QGIS handled everything gracefully even though it couldn't find the project where it was expecting to find it.

Conclusion

Will need someone to repro this and report more details.

MattReimer commented 5 months ago

This is part of a family of bugs (related but not duplicates) that will all be closed together

MattReimer commented 5 months ago

This particular bug doesn't have an example project or repro steps I can work with so I'm closing it in favour of the others. Hopefully the changes coming in 0.9.2 fix some/all of these types of problems.