292 txt = self.resultbox.toPlainText() |
292 txt = self.resultbox.toPlainText() |
293 |
293 |
294 try: |
294 try: |
295 with open(fname, "w", encoding="utf-8") as f: |
295 with open(fname, "w", encoding="utf-8") as f: |
296 f.write(txt) |
296 f.write(txt) |
297 except IOError as err: |
297 except OSError as err: |
298 E5MessageBox.critical( |
298 E5MessageBox.critical( |
299 self, |
299 self, |
300 self.tr("Error saving data"), |
300 self.tr("Error saving data"), |
301 self.tr("""<p>The data could not be written""" |
301 self.tr("""<p>The data could not be written""" |
302 """ to <b>{0}</b></p><p>Reason: {1}</p>""") |
302 """ to <b>{0}</b></p><p>Reason: {1}</p>""") |