harden execute_js_rich + fix GBK encoding crash on pyw
This commit is contained in:
4
stapp.py
4
stapp.py
@@ -1,6 +1,10 @@
|
||||
import os, sys
|
||||
if sys.stdout is None: sys.stdout = open(os.devnull, "w")
|
||||
if sys.stderr is None: sys.stderr = open(os.devnull, "w")
|
||||
try: sys.stdout.reconfigure(errors='replace')
|
||||
except: pass
|
||||
try: sys.stderr.reconfigure(errors='replace')
|
||||
except: pass
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
||||
|
||||
import streamlit as st
|
||||
|
||||
Reference in New Issue
Block a user