From 2329e8258873e195fd76bf625fefee5be0a4e112 Mon Sep 17 00:00:00 2001 From: Research Assistant Date: Wed, 29 Apr 2026 01:06:59 +0800 Subject: [PATCH] fix: include styles.css in package data; prevent Unicode crash on pip output --- paperforge/__init__.py | 2 +- paperforge/worker/update.py | 6 +++--- pyproject.toml | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/paperforge/__init__.py b/paperforge/__init__.py index f1343f4f..d4148316 100644 --- a/paperforge/__init__.py +++ b/paperforge/__init__.py @@ -1,3 +1,3 @@ """paperforge — PaperForge package.""" -__version__ = "1.4.9" +__version__ = "1.4.10" diff --git a/paperforge/worker/update.py b/paperforge/worker/update.py index de931a0c..0572841d 100644 --- a/paperforge/worker/update.py +++ b/paperforge/worker/update.py @@ -161,7 +161,7 @@ def _update_via_pip(editable: bool = False) -> bool: cmd.append(GITHUB_PIP_SOURCE) logger.info("执行: %s", " ".join(cmd)) - r = subprocess.run(cmd, capture_output=True, text=True, encoding="utf-8") + r = subprocess.run(cmd, capture_output=True, text=True, encoding="utf-8", errors="replace") if r.returncode != 0: logger.error("pip 更新失败: %s", r.stderr) return False @@ -176,12 +176,12 @@ def _update_via_git(vault: Path) -> bool: if not (vault / ".git").is_dir(): logger.error("不是 git 仓库") return False - r = subprocess.run(["git", "status", "--short"], cwd=vault, capture_output=True, text=True, encoding="utf-8") + r = subprocess.run(["git", "status", "--short"], cwd=vault, capture_output=True, text=True, encoding="utf-8", errors="replace") if r.stdout.strip(): logger.warning("有未提交的更改,请先提交或储藏") return False logger.info("执行 git pull...") - r = subprocess.run(["git", "pull", "origin", "master"], cwd=vault, capture_output=True, text=True, encoding="utf-8") + r = subprocess.run(["git", "pull", "origin", "master"], cwd=vault, capture_output=True, text=True, encoding="utf-8", errors="replace") if r.returncode != 0: logger.error("git pull 失败: %s", r.stderr) return False diff --git a/pyproject.toml b/pyproject.toml index a2104b98..3b9cd8e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,6 +56,7 @@ paperforge = [ "skills/literature-qa/chart-reading/*.md", "skills/literature-qa/chart-reading/*", "command_files/*.md", + "plugin/*.css", "plugin/*.js", "plugin/*.json", ]