##// END OF EJS Templates
Use proper subprocess commands instead of modifying the command line....
Matthias Bussonnier -
Show More
@@ -15,9 +15,11 b' rid of that dependency, we could move it there.'
15 15
16 16
17 17 import os
18 import io
18 19 import re
19 20 import sys
20 21 import tempfile
22 import subprocess
21 23
22 24 from io import UnsupportedOperation
23 25
@@ -208,9 +210,13 b' def pager_page(strng, start=0, screen_lines=0, pager_cmd=None):'
208 210 else:
209 211 try:
210 212 retval = None
211 # if I use popen4, things hang. No idea why.
212 #pager,shell_out = os.popen4(pager_cmd)
213 pager = os.popen(pager_cmd + ' 2>/dev/null', 'w')
213 # Emulate os.popen, but redirect stderr
214 proc = subprocess.Popen(pager_cmd,
215 shell=True,
216 stdin=subprocess.PIPE,
217 stderr=subprocess.DEVNULL
218 )
219 pager = os._wrap_close(io.TextIOWrapper(proc.stdin), proc)
214 220 try:
215 221 pager_encoding = pager.encoding or sys.stdout.encoding
216 222 pager.write(strng)
General Comments 0
You need to be logged in to leave comments. Login now