--- a/src/eric7/RemoteServer/EricServer.py Fri Feb 23 16:52:01 2024 +0100 +++ b/src/eric7/RemoteServer/EricServer.py Mon Feb 26 10:41:10 2024 +0100 @@ -130,7 +130,7 @@ """ if isinstance(jsonCommand, dict): jsonCommand = json.dumps(jsonCommand) - print("Eric Server Send:", jsonCommand) + # - print("Eric Server Send:", jsonCommand) # for debugging data = jsonCommand.encode("utf8", "backslashreplace") header = struct.pack(b"!II", len(data), zlib.adler32(data) & 0xFFFFFFFF) @@ -157,7 +157,6 @@ try: newData = sock.recv(length - len(data)) if not newData: - print(str(newData)) return None data += newData @@ -204,7 +203,7 @@ return {} jsonStr = data.decode("utf8", "backslashreplace") - print("Eric Server Receive:", jsonStr) + # - print("Eric Server Receive:", jsonStr) # for debugging try: return json.loads(jsonStr.strip()) except (TypeError, ValueError) as err: @@ -283,6 +282,7 @@ self.__socket.listen(0) self.__socket.setblocking(False) print(f"Listening for 'eric-ide' connections on {self.__socket.getsockname()}") + # noqa: M801 data = types.SimpleNamespace( name="server", acceptHandler=self.__acceptIdeConnection ) @@ -304,7 +304,7 @@ """ self.__closeIdeConnection(shutdown=True) - print("Stop listening for 'eric-ide' connections.") + print("Stop listening for 'eric-ide' connections.") # noqa: M801 if self.__socket is not None: self.__socket.shutdown(socket.SHUT_RDWR) self.__socket.close() @@ -321,6 +321,7 @@ connection, address = sock.accept() # Should be ready to read if self.__connection is None: print(f"'eric-ide' connection from {address[0]}, port {address[1]}") + # noqa: M801 self.__connection = connection self.__connection.setblocking(False) data = types.SimpleNamespace( @@ -331,7 +332,7 @@ self.__unregisterIdeSocket() else: - print( + print( # noqa: M801 f"'eric-ide' connection from {address[0]}, port {address[1]} rejected" ) connection.close() @@ -346,14 +347,14 @@ if self.__connection is not None: self.__selector.unregister(self.__connection) try: - print( + print( # noqa: M801 f"Closing 'eric-ide' connection to" f" {self.__connection.getpeername()}." ) self.__connection.shutdown(socket.SHUT_RDWR) self.__connection.close() except OSError: - print("'eric-ide' connection gone.") + print("'eric-ide' connection gone.") # noqa: M801 self.__connection = None self.__debuggerRequestHandler.shutdownClients() @@ -425,7 +426,8 @@ tbinfofile.seek(0) tbinfo = tbinfofile.read() - print(f"{str(exctype)} / {str(excval)} / {tbinfo}") + print("Stopping due to an exception.\nDetails:") # noqa: M801 + print(f"{str(exctype)} / {str(excval)} / {tbinfo}") # noqa: M801 self.__shouldStop = True cleanExit = False