From 35710678bc56b4a078253a2b89377c7d4efeab0c Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Thu, 21 Feb 2013 14:19:09 +0400 Subject: [PATCH] Fix wrong cat --- calculate/lib/utils/files.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/calculate/lib/utils/files.py b/calculate/lib/utils/files.py index 82d9f8f..1f6d153 100644 --- a/calculate/lib/utils/files.py +++ b/calculate/lib/utils/files.py @@ -276,9 +276,12 @@ class typeFile: # fix for kernel 3.7.7 (bad work samba) if ret is None and self.magicObject.errno() == 5: r,w = os.pipe() - cat = subprocess.Popen(['/bin/cat',filename],stdout=w) + devnull = os.open(os.devnull,os.O_WRONLY) + cat = subprocess.Popen(['/bin/cat',filename],stdout=w, + stderr=devnull) ret = self.magicObject.descriptor(r) os.close(w) + os.close(devnull) cat.poll() return ret