diff -r 3257703e10c5 -r 9978016560ec eric6/PluginManager/PluginInstallDialog.py --- a/eric6/PluginManager/PluginInstallDialog.py Tue Oct 13 19:02:26 2020 +0200 +++ b/eric6/PluginManager/PluginInstallDialog.py Wed Oct 14 17:50:39 2020 +0200 @@ -464,18 +464,16 @@ d = os.path.dirname(outname) if not os.path.exists(d): self.__makedirs(d) - f = open(outname, "wb") - f.write(zipFile.read(name)) - f.close() + with open(outname, "wb") as f: + f.write(zipFile.read(name)) self.__installedFiles.append(outname) self.progress.setValue(tot) # now compile user interface files compileUiFiles(os.path.join(destination, packageName), True) else: outname = os.path.join(destination, pluginFileName) - f = open(outname, "w", encoding="utf-8") - f.write(pluginSource) - f.close() + with open(outname, "w", encoding="utf-8") as f: + f.write(pluginSource) self.__installedFiles.append(outname) except os.error as why: self.__rollback()