Skip to content

Commit

Permalink
fix: webui 访问提示在Windows上的编码问题
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Nov 19, 2024
1 parent 8b36782 commit 753066c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pkg/core/bootutils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pkg/pipeline/longtext/strategies/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 753066c

Please sign in to comment.