mirror of
https://github.com/clearml/wexpect-venv
synced 2025-06-26 18:15:52 +00:00
ok both?
This commit is contained in:
@@ -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() ]
|
||||
|
||||
@@ -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}')
|
||||
|
||||
Reference in New Issue
Block a user