--- a/eric6/UI/UserInterface.py Tue Oct 13 19:02:26 2020 +0200 +++ b/eric6/UI/UserInterface.py Wed Oct 14 17:50:39 2020 +0200 @@ -3692,9 +3692,8 @@ address = BugAddress subject = "[eric6] " if attachFile is not None: - f = open(attachFile, "r", encoding="utf-8") - body = f.read() - f.close() + with open(attachFile, "r", encoding="utf-8") as f: + body = f.read() if deleteAttachFile: os.remove(attachFile) else: