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)
|
progress_bar = st.progress(0)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
import os
|
||||||
|
env = os.environ.copy()
|
||||||
|
env['PYTHONIOENCODING'] = 'utf-8'
|
||||||
|
|
||||||
process = subprocess.Popen(
|
process = subprocess.Popen(
|
||||||
cmd,
|
cmd,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT,
|
stderr=subprocess.STDOUT,
|
||||||
text=True,
|
text=True,
|
||||||
bufsize=1,
|
bufsize=1,
|
||||||
cwd=str(Path(__file__).parent.parent)
|
cwd=str(Path(__file__).parent.parent),
|
||||||
|
env=env,
|
||||||
|
encoding='utf-8',
|
||||||
|
errors='replace'
|
||||||
)
|
)
|
||||||
|
|
||||||
output_lines = []
|
output_lines = []
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue