From 753066ccb9899d3b60031a5b0173dba342a2266e Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Tue, 19 Nov 2024 19:33:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20webui=20=E8=AE=BF=E9=97=AE=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E5=9C=A8Windows=E4=B8=8A=E7=9A=84=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/core/bootutils/log.py | 5 ++++- pkg/pipeline/longtext/strategies/image.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/core/bootutils/log.py b/pkg/core/bootutils/log.py index ce53efd5..62359dec 100644 --- a/pkg/core/bootutils/log.py +++ b/pkg/core/bootutils/log.py @@ -42,8 +42,11 @@ async def init_logging(extra_handlers: list[logging.Handler] = None) -> logging. ) stream_handler = logging.StreamHandler(sys.stdout) + # stream_handler.setLevel(level) + # stream_handler.setFormatter(color_formatter) + stream_handler.stream = open(sys.stdout.fileno(), mode='w', encoding='utf-8', buffering=1) - log_handlers: list[logging.Handler] = [stream_handler, logging.FileHandler(log_file_name)] + log_handlers: list[logging.Handler] = [stream_handler, logging.FileHandler(log_file_name, encoding='utf-8')] log_handlers += extra_handlers if extra_handlers is not None else [] for handler in log_handlers: diff --git a/pkg/pipeline/longtext/strategies/image.py b/pkg/pipeline/longtext/strategies/image.py index 9e32e598..b9675074 100644 --- a/pkg/pipeline/longtext/strategies/image.py +++ b/pkg/pipeline/longtext/strategies/image.py @@ -58,7 +58,7 @@ class Text2ImageStrategy(strategy_model.LongTextStrategy): """ kv = [] nums = [] - beforeDatas = re.findall('[\d]+', path) + beforeDatas = re.findall('[\\d]+', path) for num in beforeDatas: indexV = [] times = path.count(num)