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