From 36baca3f961eaf7e7e94eb73e882b934f2447ce9 Mon Sep 17 00:00:00 2001 From: hect0x7 <93357912+hect0x7@users.noreply.github.com> Date: Fri, 20 Feb 2026 16:34:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?v2.6.14:=20=E6=9B=B4=E6=96=B0=E7=A6=81?= =?UTF-8?q?=E6=BC=AB=E5=8F=91=E5=B8=83=E9=A1=B5=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmcomic/__init__.py | 2 +- src/jmcomic/jm_config.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/jmcomic/__init__.py b/src/jmcomic/__init__.py index 0c32715de..7f6f32172 100644 --- a/src/jmcomic/__init__.py +++ b/src/jmcomic/__init__.py @@ -2,7 +2,7 @@ # 被依赖方 <--- 使用方 # config <--- entity <--- toolkit <--- client <--- option <--- downloader -__version__ = '2.6.13' +__version__ = '2.6.14' from .api import * from .jm_plugin import * diff --git a/src/jmcomic/jm_config.py b/src/jmcomic/jm_config.py index b26c85d7a..2b99b3d4d 100644 --- a/src/jmcomic/jm_config.py +++ b/src/jmcomic/jm_config.py @@ -80,7 +80,7 @@ class JmMagicConstants: APP_TOKEN_SECRET_2 = '18comicAPPContent' APP_DATA_SECRET = '185Hcomic3PAPP7R' API_DOMAIN_SERVER_SECRET = 'diosfjckwpqpdfjkvnqQjsik' - APP_VERSION = '2.0.16' + APP_VERSION = '2.0.18' # 模块级别共用配置 @@ -88,7 +88,7 @@ class JmModuleConfig: # 网站相关 PROT = "https://" JM_REDIRECT_URL = f'{PROT}jm365.work/3YeBdF' # 永久網域,怕走失的小伙伴收藏起来 - JM_PUB_URL = f'{PROT}jmcomic-fb.vip' + JM_PUB_URL = f'{PROT}jmcomicgo.org' JM_CDN_IMAGE_URL_TEMPLATE = PROT + 'cdn-msp.{domain}/media/photos/{photo_id}/{index:05}{suffix}' # index 从1开始 JM_IMAGE_SUFFIX = ['.jpg', '.webp', '.png', '.gif'] From 8f4e555fe83970dbca10a40070c84783610133bf Mon Sep 17 00:00:00 2001 From: hect0x7 <93357912+hect0x7@users.noreply.github.com> Date: Fri, 20 Feb 2026 16:49:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B5=8B=E8=AF=95case?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_jmcomic/__init__.py | 10 ++++++---- tests/test_jmcomic/test_jm_client.py | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/test_jmcomic/__init__.py b/tests/test_jmcomic/__init__.py index 79d26f63a..43e073eb1 100644 --- a/tests/test_jmcomic/__init__.py +++ b/tests/test_jmcomic/__init__.py @@ -1,4 +1,3 @@ -import io import platform import unittest @@ -6,9 +5,12 @@ import jmcomic from jmcomic import * -# set encoding -sys.stdout = io.TextIOWrapper(sys.stdout.buffer, 'utf-8') -sys.stderr = io.TextIOWrapper(sys.stderr.buffer, 'utf-8') +# 设置编码为 utf-8,使用 reconfigure() 而非替换 sys.stdout 对象 +# 直接替换会破坏 pytest 的 I/O 捕获机制,导致 "I/O operation on closed file" 错误 +if hasattr(sys.stdout, 'reconfigure'): + sys.stdout.reconfigure(encoding='utf-8') +if hasattr(sys.stderr, 'reconfigure'): + sys.stderr.reconfigure(encoding='utf-8') # 获取项目根目录 project_dir = os.path.abspath(os.path.dirname(__file__) + '/../..') os.chdir(project_dir) diff --git a/tests/test_jmcomic/test_jm_client.py b/tests/test_jmcomic/test_jm_client.py index 046631e97..e7a484a8a 100644 --- a/tests/test_jmcomic/test_jm_client.py +++ b/tests/test_jmcomic/test_jm_client.py @@ -186,7 +186,7 @@ def search_and_test(expected_result, params): cases = { 152637: { 'search_query': '无修正', - 'order_by': JmMagicConstants.ORDER_BY_LIKE, + 'order_by': JmMagicConstants.ORDER_BY_VIEW, 'time': JmMagicConstants.TIME_ALL, }, 147643: {