Skip to content

Commit

Permalink
handling Errno:9 Resource temporarily unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
shoyebi committed Jun 17, 2015
1 parent 3db3764 commit 0db351f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion exiftool.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@

from __future__ import unicode_literals

import select
import sys
import subprocess
import os
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 0db351f

Please sign in to comment.