--- a/eric6/Project/ProjectTranslationsBrowser.py Tue Oct 13 19:02:26 2020 +0200 +++ b/eric6/Project/ProjectTranslationsBrowser.py Wed Oct 14 17:50:39 2020 +0200 @@ -809,15 +809,14 @@ if not os.path.exists(outDir): os.makedirs(outDir) try: - pf = open(outFile, "w", encoding="utf-8") - for key, fileList in sections: - if len(fileList) > 0: - pf.write('{0} = '.format(key)) - pf.write(' \\\n\t'.join( - [f.replace(os.sep, '/') for f in fileList])) - pf.write('\n\n') + with open(outFile, "w", encoding="utf-8") as pf: + for key, fileList in sections: + if len(fileList) > 0: + pf.write('{0} = '.format(key)) + pf.write(' \\\n\t'.join( + [f.replace(os.sep, '/') for f in fileList])) + pf.write('\n\n') - pf.close() self.__tmpProjects.append(outFile) except IOError: E5MessageBox.critical(