From 4b91485079de257e8d545ba49aba23d1172d8f46 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Sun, 22 Mar 2020 16:51:25 +1300 Subject: [PATCH] exec() the tunnel command There is no reason that the shell invoking the tunnel command needs to stay around. Using `exec` to replace the parent with the tunnel command works just fine and results in a cleaner process table. --- offlineimap/imaplibutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/offlineimap/imaplibutil.py b/offlineimap/imaplibutil.py index 44338f6..86b1cb9 100644 --- a/offlineimap/imaplibutil.py +++ b/offlineimap/imaplibutil.py @@ -132,7 +132,7 @@ class IMAP4_Tunnel(UsefulIMAPMixIn, IMAP4): """The tunnelcmd comes in on host!""" self.host = host - self.process = subprocess.Popen(host, shell=True, close_fds=True, + self.process = subprocess.Popen('exec %s'%host, shell=True, close_fds=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE) (self.outfd, self.infd) = (self.process.stdin, self.process.stdout) # imaplib2 polls on this fd