This commit is contained in:
Benedek Racz
2020-02-04 12:00:46 +01:00
parent 8aacdb7cc0
commit a1774de30e
2 changed files with 6 additions and 1 deletions

View File

@@ -76,6 +76,7 @@ import signal
import socket
import logging
import windll
import pywintypes
import win32process
import win32con
@@ -136,6 +137,7 @@ class SpawnBase:
self.timeout = timeout
self.delimiter = EOF
self.cwd = cwd
self.codepage = codepage
self.env = env
self.echo = echo
self.maxread = maxread # max bytes to read at one time into buffer
@@ -223,10 +225,13 @@ class SpawnBase:
else:
python_executable = os.path.join(os.path.dirname(sys.executable), 'python.exe')
cp = self.codepage or windll.kernel32.GetACP()
self.console_class_parameters.update({
'host_pid': self.host_pid,
'local_echo': self.echo,
'interact': self.interact_state,
'cp': cp,
'just_init': True
})
console_class_parameters_kv_pairs = [f'{k}={v}' for k,v in self.console_class_parameters.items() ]

View File

@@ -633,7 +633,7 @@ class Wtty:
' '.join(pyargs),
f"import sys; sys.path = {spath} + sys.path;"
f"args = {args}; import wexpect;"
f"wexpect.ConsoleReaderPipe(wexpect.join_args(args), {pid}, just_init=True)"
f"wexpect.ConsoleReaderPipe(wexpect.join_args(args), {pid}, cp={cp}, just_init=True)"
)
logger.info(f'CreateProcess: {commandLine}')