--- a/src/eric7/Project/ProjectResourcesBrowser.py Mon Dec 19 17:50:02 2022 +0100 +++ b/src/eric7/Project/ProjectResourcesBrowser.py Mon Dec 19 19:31:43 2022 +0100 @@ -641,10 +641,12 @@ self.compileProc.setReadChannel(QProcess.ProcessChannel.StandardOutput) while self.compileProc and self.compileProc.canReadLine(): - self.buf += str( - self.compileProc.readLine(), - Preferences.getSystem("IOEncoding"), - "replace", + self.__buf.append( + str( + self.compileProc.readLine(), + Preferences.getSystem("IOEncoding"), + "replace", + ).rstrip() ) def __readStderr(self): @@ -674,15 +676,18 @@ self.compileRunning = False ericApp().getObject("ViewManager").enableEditorsCheckFocusIn(True) ui = ericApp().getObject("UserInterface") - if exitStatus == QProcess.ExitStatus.NormalExit and exitCode == 0 and self.buf: + if ( + exitStatus == QProcess.ExitStatus.NormalExit + and exitCode == 0 + and self.__buf + ): ofn = os.path.join(self.project.ppath, self.compiledFile) try: newline = ( None if self.project.useSystemEol() else self.project.getEolString() ) with open(ofn, "w", encoding="utf-8", newline=newline) as f: - for line in self.buf.splitlines(): - f.write(line + "\n") + f.write("\n".join(self.__buf) + "\n") if self.compiledFile not in self.project.getProjectData( dataKey="SOURCES" ): @@ -723,7 +728,7 @@ """ self.compileProc = QProcess() args = [] - self.buf = "" + self.__buf = [] if self.project.getProjectLanguage() == "Python3": if self.project.getProjectType() in ["PyQt5", "PyQt5C"]: