From 13f7bd7a2af79f279a9a3779eddfaf1397ea0139 Mon Sep 17 00:00:00 2001 From: gorf Date: Tue, 2 Jun 2026 16:32:39 +0800 Subject: [PATCH] fix: avoid f-string backslash syntax error in xiaohongshu uploader Move newline normalization out of the f-string expression so the CLI can import and run under Python 3.11+ without syntax errors. Co-authored-by: Cursor --- uploader/xiaohongshu_uploader/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/uploader/xiaohongshu_uploader/main.py b/uploader/xiaohongshu_uploader/main.py index 7ae0e8e..c12dbdb 100644 --- a/uploader/xiaohongshu_uploader/main.py +++ b/uploader/xiaohongshu_uploader/main.py @@ -515,7 +515,8 @@ class XiaoHongShuVideo(XiaoHongShuBaseUploader): break if self.debug: - xiaohongshu_logger.debug(_msg("🧍", f"预览区域内容: {all_text.strip().replace('\\n', ' ')}")) + normalized_text = all_text.strip().replace("\n", " ") + xiaohongshu_logger.debug(_msg("🧍", f"预览区域内容: {normalized_text}")) xiaohongshu_logger.debug(_msg("🧍", "还没看到上传成功标识,小人继续等一会")) else: # 尝试检查标题输入框是否已经出现,如果是,说明已经进入编辑状态