summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/linemode.py11
-rw-r--r--ranger/ext/vcs/vcs.py8
2 files changed, 16 insertions, 3 deletions
diff --git a/ranger/core/linemode.py b/ranger/core/linemode.py
index 96557515..f63cb142 100644
--- a/ranger/core/linemode.py
+++ b/ranger/core/linemode.py
@@ -97,9 +97,16 @@ class FileInfoLinemode(LinemodeBase):
 
     def infostring(self, file, metadata):
         if not file.is_directory:
-            from subprocess import check_output, CalledProcessError
+            from subprocess import Popen, PIPE, CalledProcessError
             try:
-                fileinfo = check_output(["file", "-bL", file.path]).strip()
+                process = Popen(["file", "-bL", file.path], stdout=PIPE)
+                output, unused_err = process.communicate()
+                retcode = process.poll()
+                if retcode:
+                    error = subprocess.CalledProcessError(retcode, "file")
+                    error.output = output
+                    raise error
+                fileinfo = output.strip()
             except CalledProcessError:
                 return "unknown"
             if sys.version_info[0] >= 3:
diff --git a/ranger/ext/vcs/vcs.py b/ranger/ext/vcs/vcs.py
index cb8137e3..a101e3f4 100644
--- a/ranger/ext/vcs/vcs.py
+++ b/ranger/ext/vcs/vcs.py
@@ -119,7 +119,13 @@ class Vcs(object):  # pylint: disable=too-many-instance-attributes
         with open(os.devnull, 'w') as devnull:
             try:
                 if catchout:
-                    output = subprocess.check_output(cmd, cwd=path, stderr=devnull)
+                    process = subprocess.Popen(cmd, cwd=path, stdout=subprocess.PIPE, stderr=devnull)
+                    output, unused_err = process.communicate()
+                    retcode = process.poll()
+                    if retcode:
+                        error = subprocess.CalledProcessError(retcode, cmd)
+                        error.output = output
+                        raise error
                     if retbytes:
                         return output
                     else:
0c4d6122182c37a8b37d27fd1e8e896cbdbe928'>00c4d612 ^
372367f5 ^
00c4d612 ^
































3350c34a ^
00c4d612 ^



a8fb537a ^
00c4d612 ^
a8fb537a ^
00c4d612 ^
a8fb537a ^
3350c34a ^
a8fb537a ^
372367f5 ^
3350c34a ^


dd60caa3 ^
3350c34a ^


dd60caa3 ^
3350c34a ^
dd60caa3 ^
3350c34a ^





49f7a917 ^
00c4d612 ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92