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 @@ def indexNumber(self, path=''): """ kv = [] nums = [] - beforeDatas = re.findall('[\d]+', path) + beforeDatas = re.findall('[\\d]+', path) for num in beforeDatas: indexV = [] times = path.count(num)