907 self.tr("A file or directory named <b>{0}</b> exists" |
907 self.tr("A file or directory named <b>{0}</b> exists" |
908 " already. Aborting...") |
908 " already. Aborting...") |
909 .format(fname)) |
909 .format(fname)) |
910 else: |
910 else: |
911 try: |
911 try: |
912 f = open(filepath, "w") |
912 with open(filepath, "w"): |
913 f.close() |
913 pass |
914 except OSError as err: |
914 except OSError as err: |
915 E5MessageBox.critical( |
915 E5MessageBox.critical( |
916 self, |
916 self, |
917 self.tr("New File"), |
917 self.tr("New File"), |
918 self.tr("<p>The file <b>{0}</b> could not be" |
918 self.tr("<p>The file <b>{0}</b> could not be" |