--- a/eric6/Templates/TemplateViewer.py Thu Jan 28 16:35:55 2021 +0100 +++ b/eric6/Templates/TemplateViewer.py Thu Jan 28 16:36:29 2021 +0100 @@ -595,7 +595,17 @@ ex = selectedFilter.split("(*")[1].split(")")[0] if ex: fn += ex - self.writeTemplates(fn) + if os.path.exists(fn): + ok = E5MessageBox.yesNo( + self, + self.tr("Export Templates"), + self.tr("""<p>The templates file <b>{0}</b> exists""" + """ already. Overwrite it?</p>""").format(fn)) + else: + ok = True + + if ok: + self.writeTemplates(fn) def __reload(self): """