mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-11-01 21:07:01 +08:00
fix(types): expose stdio stream encoding
This commit is contained in:
@@ -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
|
||||
|
||||
1
mypy.ini
1
mypy.ini
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user