--- a/eric6/DebugClients/Python/DebugClientBase.py Thu Dec 31 17:42:50 2020 +0100 +++ b/eric6/DebugClients/Python/DebugClientBase.py Fri Jan 01 16:25:30 2021 +0100 @@ -1281,18 +1281,12 @@ remoteAddress = remoteAddress.split("@@i")[0] sock = socket.create_connection((remoteAddress, port)) - if not name: - name = "main" - self.__debuggerId = "{0}-{1}-{2}".format( - socket.gethostname(), os.getpid(), name - ) + stdinName = sys.stdin.name + # Special case if in a multiprocessing.Process + if isinstance(stdinName, int): + stdinName = '<stdin>' - name = sys.stdin.name - # Special case if in a multiprocessing.Process - if isinstance(name, int): - name = '<stdin>' - - self.readstream = AsyncFile(sock, sys.stdin.mode, name) + self.readstream = AsyncFile(sock, sys.stdin.mode, stdinName) self.writestream = AsyncFile(sock, sys.stdout.mode, sys.stdout.name) self.errorstream = AsyncFile(sock, sys.stderr.mode, sys.stderr.name) @@ -1305,6 +1299,12 @@ # attach to the main thread here self.attachThread(mainThread=True) + if not name: + name = "main" + self.__debuggerId = "{0}/{1}/{2}".format( + socket.gethostname(), os.getpid(), name + ) + self.sendDebuggerId(self.__debuggerId) def __unhandled_exception(self, exctype, excval, exctb):