diff --git a/exiftool.py b/exiftool.py index 8a11daa..41ed7ef 100644 --- a/exiftool.py +++ b/exiftool.py @@ -55,6 +55,7 @@ from __future__ import unicode_literals +import select import sys import subprocess import os @@ -223,7 +224,10 @@ def execute(self, *params): output = b"" fd = self._process.stdout.fileno() while not output[-32:].strip().endswith(sentinel): - output += os.read(fd, block_size) + inputready,outputready,exceptready = select.select([fd],[],[]) + for i in inputready: + if i == fd: + output += os.read(fd, block_size) return output.strip()[:-len(sentinel)] def execute_json(self, *params):