Show More
@@ -1130,10 +1130,10 b' class ui(object):' | |||
|
1130 | 1130 | |
|
1131 | 1131 | try: |
|
1132 | 1132 | pager = subprocess.Popen( |
|
1133 | command, shell=shell, bufsize=-1, | |
|
1133 | procutil.tonativestr(command), shell=shell, bufsize=-1, | |
|
1134 | 1134 | close_fds=procutil.closefds, stdin=subprocess.PIPE, |
|
1135 | 1135 | stdout=procutil.stdout, stderr=procutil.stderr, |
|
1136 | env=procutil.shellenviron(env)) | |
|
1136 | env=procutil.tonativeenv(procutil.shellenviron(env))) | |
|
1137 | 1137 | except OSError as e: |
|
1138 | 1138 | if e.errno == errno.ENOENT and not shell: |
|
1139 | 1139 | self.warn(_("missing pager command '%s', skipping pager\n") |
@@ -320,10 +320,19 b' def shellenviron(environ=None):' | |||
|
320 | 320 | if pycompat.iswindows: |
|
321 | 321 | def shelltonative(cmd, env): |
|
322 | 322 | return platform.shelltocmdexe(cmd, shellenviron(env)) |
|
323 | ||
|
324 | tonativestr = encoding.strfromlocal | |
|
323 | 325 | else: |
|
324 | 326 | def shelltonative(cmd, env): |
|
325 | 327 | return cmd |
|
326 | 328 | |
|
329 | tonativestr = pycompat.identity | |
|
330 | ||
|
331 | def tonativeenv(env): | |
|
332 | '''convert the environment from bytes to strings suitable for Popen(), etc. | |
|
333 | ''' | |
|
334 | return pycompat.rapply(tonativestr, env) | |
|
335 | ||
|
327 | 336 | def system(cmd, environ=None, cwd=None, out=None): |
|
328 | 337 | '''enhanced shell command execution. |
|
329 | 338 | run with environment maybe modified, maybe in different dir. |
General Comments 0
You need to be logged in to leave comments.
Login now