From 77b96b97c8b9562fb3eefb489446d27529ff411a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 9 Dec 2014 19:54:49 +0100 Subject: [PATCH] fix #343 - close fds of mkstemp for messages Signed-off-by: Nico Schottelius --- cdist/message.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cdist/message.py b/cdist/message.py index b840a84d..f9b0c313 100644 --- a/cdist/message.py +++ b/cdist/message.py @@ -37,12 +37,14 @@ class Message(object): self.prefix = prefix self.global_messages = messages - self.messages_in = tempfile.mkstemp(suffix='.cdist_message_in')[1] - self.messages_out = tempfile.mkstemp(suffix='.cdist_message_out')[1] + in_fd, self.messages_in = tempfile.mkstemp(suffix='.cdist_message_in') + out_fd, self.messages_out = tempfile.mkstemp(suffix='.cdist_message_out') + + os.close(in_fd) + os.close(out_fd) self._copy_messages() - @property def env(self): env = {}