fix(types): expose stdio stream encoding

This commit is contained in:
jxxghp
2026-10-17 07:19:38 +08:00
parent 7ecf9a80f5
commit f26aca38a4
3 changed files with 3 additions and 8 deletions

View File

@@ -16,6 +16,8 @@ class RotatingLineStream(io.TextIOBase):
同时保证启动阶段的 print/uvicorn 输出也能按配置滚动。
"""
encoding = "utf-8"
def __init__(self, log_file: Path, max_bytes: int, backup_count: int):
"""创建写入指定滚动日志文件的文本流。"""
super().__init__()
@@ -37,11 +39,6 @@ class RotatingLineStream(io.TextIOBase):
handler.setFormatter(logging.Formatter("%(message)s"))
self._logger.addHandler(handler)
@property
def encoding(self) -> str:
"""返回日志流使用的文本编码。"""
return "utf-8"
def writable(self) -> bool:
"""声明该文本流支持写入。"""
return True

View File

@@ -7,6 +7,7 @@ follow_imports = skip
show_error_codes = True
pretty = True
files =
app/adapters/system/stdio.py,
app/adapters/web/plugin/routes.py,
app/api/endpoints/workflow.py,
app/adapters/external/cookiecloud.py,

View File

@@ -75,9 +75,6 @@
"no-untyped-def": 1,
"type-arg": 19
},
"app/adapters/system/stdio.py": {
"override": 1
},
"app/agent/llm/capability.py": {
"no-any-return": 4,
"no-untyped-def": 6,