[FIX] Report: handle PermissionError when trying to save#2225
[FIX] Report: handle PermissionError when trying to save#2225janezd merged 1 commit intobiolab:masterfrom jerneju:permission-report
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2225 +/- ##
=======================================
Coverage 72.37% 72.37%
=======================================
Files 319 319
Lines 55014 55014
=======================================
Hits 39819 39819
Misses 15195 15195 |
Orange/canvas/report/owreport.py
Outdated
| class PyBridge(QObject): | ||
| @pyqtSlot(str) | ||
| def _select_item(myself, item_id): | ||
| def _select_item(self, item_id): |
There was a problem hiding this comment.
I suppose this argument should have stayed myself; using self here shadows the self from the outer scope.
See the line below: do instances of QObject have an attribute table_model?
There was a problem hiding this comment.
Shame on me. I blindly followed lint's complaints.
Orange/canvas/report/owreport.py
Outdated
|
|
||
| @pyqtSlot(str, str) | ||
| def _add_comment(myself, item_id, value): | ||
| def _add_comment(self, item_id, value): |
Orange/canvas/report/owreport.py
Outdated
| try: | ||
| report = self.load(filename) | ||
| except (IOError, AttributeError) as e: | ||
| except (IOError, AttributeError): |
There was a problem hiding this comment.
I tried to open a file with extension .report, but which was not actually a report file. It crashes with UnpicklingError. Perhaps you should add it to list, or even catch the general Exception here.
Orange/canvas/report/owreport.py
Outdated
| parent=self) | ||
| self.tr("Could not load an Orange Report file"), | ||
| title=self.tr("Error"), | ||
| informative_text=self.tr("An unexpected error occurred " |
There was a problem hiding this comment.
Remove unexpected (all errors are unexpected) and probably also the article, hence "Error occurred while loading '%s'.
Orange/canvas/report/owreport.py
Outdated
| self.tr("Could not load an Orange Report file"), | ||
| title=self.tr("Error"), | ||
| informative_text=self.tr("An unexpected error occurred " | ||
| "while loading '%s'.") % filename, |
There was a problem hiding this comment.
Use formatting with {} and format, not the C-style %. I would say the the old-style is permitted in Orange only for consistency in the modules that (still) use the old style.
Issue
https://sentry.io/biolab/orange3/issues/251030241/
Description of changes
Now shows a windows with error message and logs error as well.
Includes