Plugins/VcsPlugins/vcsMercurial/HgDiffDialog.py

changeset 1300
9083f6b7ea3b
parent 1297
6347cf782036
child 1318
6fa303bd65d6
equal deleted inserted replaced
1299:fd5d21389d2b 1300:9083f6b7ea3b
340 return 340 return
341 fname = Utilities.toNativeSeparators(fname) 341 fname = Utilities.toNativeSeparators(fname)
342 342
343 eol = e5App().getObject("Project").getEolString() 343 eol = e5App().getObject("Project").getEolString()
344 try: 344 try:
345 f = open(fname, "w", encoding="utf-8") 345 f = open(fname, "w", encoding="utf-8", newline="")
346 f.write(eol.join(self.contents.toPlainText().splitlines())) 346 f.write(eol.join(self.contents.toPlainText().splitlines()))
347 f.close() 347 f.close()
348 except IOError as why: 348 except IOError as why:
349 E5MessageBox.critical(self, self.trUtf8('Save Diff'), 349 E5MessageBox.critical(self, self.trUtf8('Save Diff'),
350 self.trUtf8('<p>The patch file <b>{0}</b> could not be saved.' 350 self.trUtf8('<p>The patch file <b>{0}</b> could not be saved.'

eric ide

mercurial