From a2a0046f53c290a22d58b1773f6a9efb4d2534aa Mon Sep 17 00:00:00 2001 From: smail Date: Thu, 17 Sep 2026 10:19:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=9C=E7=A8=8B=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E8=84=9A=E6=9C=AC=E8=AF=AD=E6=B3=95=E5=B9=B6=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E5=B7=A5=E5=85=B7=E6=A3=80=E6=9F=A5=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/远程服务器测试记录.md | 2 ++ test/tools/debug_ssh.py | 28 ++++++++++++++-------------- test/tools/test_echo.py | 4 ++-- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/docs/远程服务器测试记录.md b/docs/远程服务器测试记录.md index c72a90f..2ca4199 100644 --- a/docs/远程服务器测试记录.md +++ b/docs/远程服务器测试记录.md @@ -190,6 +190,8 @@ TLS 前未公布 AUTH,主动尝试明文 AUTH 返回 523。未认证外域邮 前端生产构建和 Linux amd64 编译通过,仍有编辑器分块超过 500 kB 的构建提示。没有重新执行全部后端包、竞态检测、移动端、真实 MySQL 或 PostgreSQL 验证。 +后续工具静态编译发现本轮涉及的 `debug_ssh.py`、`test_echo.py` 原有引号缺失,已修正;没有执行会打印邮件或日志内容的诊断脚本。全工具目录静态编译仍受未改动的 `check_page.py` 语法错误及 `test_login_dashboard_backup.py` 编码错误影响,不宣称所有历史工具均可运行。静态编译只检查 Python 源码,不在本机执行应用或测试业务。 + ### 部署证据 2026 年 9 月 17 日 10:06 完成双程序升级,版本为 `remote-13bcad90e832`,源码指纹为 `13bcad90e832a9be78604854a1c91f72cfaf2a21770481c627e50ac361ce3b70`。 diff --git a/test/tools/debug_ssh.py b/test/tools/debug_ssh.py index 8ca519f..b556991 100644 --- a/test/tools/debug_ssh.py +++ b/test/tools/debug_ssh.py @@ -7,24 +7,24 @@ connect_remote(ssh) def run(cmd): stdin, stdout, stderr = ssh.exec_command(cmd) - return stdout.read().decode(utf-8, errors=ignore), stderr.read().decode(utf-8, errors=ignore) + return stdout.read().decode('utf-8', errors='replace'), stderr.read().decode('utf-8', errors='replace') -out, _ = run(ls -la /opt/smail/log) -print(=== /opt/smail/log ===\n + out) +out, _ = run('ls -la /opt/smail/log') +print('=== /opt/smail/log ===\n' + out) -out, _ = run(grep -rn 'qq.com' /opt/smail/log/ 2>/dev/null) -print(=== qq.com grep in logs ===\n + out) +out, _ = run("grep -rn 'qq.com' /opt/smail/log/ 2>/dev/null") +print('=== qq.com grep in logs ===\n' + out) -out, _ = run(sqlite3 /opt/smail/data/smail.db '.schema email') -print(=== schema email ===\n + out) +out, _ = run("sqlite3 /opt/smail/data/smail.db '.schema email'") +print('=== schema email ===\n' + out) -out, _ = run(sqlite3 /opt/smail/data/smail.db '.schema user_email') -print(=== schema user_email ===\n + out) +out, _ = run("sqlite3 /opt/smail/data/smail.db '.schema user_email'") +print('=== schema user_email ===\n' + out) -out, _ = run(sqlite3 /opt/smail/data/smail.db 'SELECT id, subject, send_time FROM email ORDER BY id DESC LIMIT 5;') -print(=== latest emails ===\n + out) +out, _ = run("sqlite3 /opt/smail/data/smail.db 'SELECT id, subject, send_date FROM email ORDER BY id DESC LIMIT 5;'") +print('=== latest emails ===\n' + out) -out, _ = run(sqlite3 /opt/smail/data/smail.db 'SELECT id, user_id, email_id, is_read FROM user_email ORDER BY id DESC LIMIT 5;') -print(=== latest user_emails ===\n + out) +out, _ = run("sqlite3 /opt/smail/data/smail.db 'SELECT id, user_id, email_id, is_read FROM user_email ORDER BY id DESC LIMIT 5;'") +print('=== latest user_emails ===\n' + out) -ssh.close() \ No newline at end of file +ssh.close() diff --git a/test/tools/test_echo.py b/test/tools/test_echo.py index eb924fd..432f198 100644 --- a/test/tools/test_echo.py +++ b/test/tools/test_echo.py @@ -4,6 +4,6 @@ ssh.set_missing_host_key_policy(paramiko.RejectPolicy()) from remote_ssh import connect_remote connect_remote(ssh) stdin, stdout, stderr = ssh.exec_command("echo HELLO") -print(stdout:, stdout.read().decode()) -print(stderr:, stderr.read().decode()) +print('stdout:', stdout.read().decode('utf-8', errors='replace')) +print('stderr:', stderr.read().decode('utf-8', errors='replace')) ssh.close()