fix: Windows Unicode encoding for subprocess output
This commit is contained in:
parent
70e72c1c09
commit
05b1186c6a
1 changed files with 8 additions and 1 deletions
|
|
@ -346,13 +346,20 @@ def main():
|
|||
progress_bar = st.progress(0)
|
||||
|
||||
try:
|
||||
import os
|
||||
env = os.environ.copy()
|
||||
env['PYTHONIOENCODING'] = 'utf-8'
|
||||
|
||||
process = subprocess.Popen(
|
||||
cmd,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
text=True,
|
||||
bufsize=1,
|
||||
cwd=str(Path(__file__).parent.parent)
|
||||
cwd=str(Path(__file__).parent.parent),
|
||||
env=env,
|
||||
encoding='utf-8',
|
||||
errors='replace'
|
||||
)
|
||||
|
||||
output_lines = []
|
||||
|
|
|
|||
Loading…
Reference in a new issue