From 0db351ff10226b2afdff2b090381e7d752847592 Mon Sep 17 00:00:00 2001 From: shoyebi Date: Fri, 12 Jun 2015 20:15:00 +0530 Subject: [PATCH] handling Errno:9 Resource temporarily unavailable --- exiftool.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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):