From 45d5e4719a83185670b4b57a469f166494c387e3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 7 Nov 2012 10:49:11 +0100 Subject: [PATCH] read from stdin using read, not buffer.read() to be compatible with other IO streams Signed-off-by: Nico Schottelius --- cdist/emulator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cdist/emulator.py b/cdist/emulator.py index f65c9bec..53c6914d 100644 --- a/cdist/emulator.py +++ b/cdist/emulator.py @@ -32,6 +32,8 @@ class Emulator(object): def __init__(self, argv, stdin=sys.stdin, env=os.environ): self.argv = argv self.stdin = stdin + self.env = env + self.object_id = False self.global_path = self.env['__global'] @@ -147,9 +149,8 @@ class Emulator(object): # Record / Append source self.cdist_object.source.append(self.object_source) - chunk_size = 8192 def _read_stdin(self): - return self.stdin.buffer.read(self.chunk_size) + return self.stdin.read() def save_stdin(self): """If something is written to stdin, save it in the object as $__object/stdin so it can be accessed in manifest and gencode-*