mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
⬆️ auto update by pre-commit hooks (#587)
* ⬆️ auto update by pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.14.14 → v0.15.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.14...v0.15.0) * Fix ASYNC240: Use async file I/O in check_hash (#591) * Initial plan * Fix ASYNC240: Replace synchronous Path.read_text() with async aiofiles operation Co-authored-by: shoucandanghehe <51957264+shoucandanghehe@users.noreply.github.com> * Add explicit UTF-8 encoding to ensure consistent behavior across platforms Co-authored-by: shoucandanghehe <51957264+shoucandanghehe@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: shoucandanghehe <51957264+shoucandanghehe@users.noreply.github.com> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: shoucandanghehe <51957264+shoucandanghehe@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
f8fde51009
commit
15d3a33cb8
@@ -71,7 +71,9 @@ def unzip_templates(zip_path: Path) -> Path:
|
||||
|
||||
async def check_hash(hash_file_path: Path) -> bool:
|
||||
logger.info('开始校验模板哈希值')
|
||||
for i in hash_file_path.read_text().splitlines():
|
||||
async with aopen(hash_file_path, encoding='utf-8') as f:
|
||||
hash_content = await f.read()
|
||||
for i in hash_content.splitlines():
|
||||
file_sha256, file_relative_path = i.split(maxsplit=1)
|
||||
file_path = hash_file_path.parent / file_relative_path
|
||||
hasher = sha256()
|
||||
|
||||
Reference in New Issue
Block a user