HibiKier / zhenxun_bot

基于 Nonebot2 开发,非常可爱的绪山真寻bot
GNU Affero General Public License v3.0
3.32k stars 605 forks source link

自动更新出错 #1346

Closed chfwd closed 1 year ago

chfwd commented 1 year ago

系统版本:Ubuntu 20.04

真寻版本:0.1.6.6

错误截图

Traceback (most recent call last):
  File "/root/QQRobot/zhenxun_bot/bot.py", line 3, in <module>
    from services.db_context import init, disconnect
  File "/root/QQRobot/zhenxun_bot/services/__init__.py", line 1, in <module>
    from .db_context import *
  File "/root/QQRobot/zhenxun_bot/services/db_context.py", line 8, in <module>
    from configs.config import address, bind, database, password, port, sql_name, user
  File "/root/QQRobot/zhenxun_bot/configs/config.py", line 11
    os.popen("cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }'")
IndentationError: unexpected indent

日志截图

Traceback (most recent call last):
  File "/root/QQRobot/zhenxun_bot/bot.py", line 3, in <module>
    from services.db_context import init, disconnect
  File "/root/QQRobot/zhenxun_bot/services/__init__.py", line 1, in <module>
    from .db_context import *
  File "/root/QQRobot/zhenxun_bot/services/db_context.py", line 8, in <module>
    from configs.config import address, bind, database, password, port, sql_name, user
  File "/root/QQRobot/zhenxun_bot/configs/config.py", line 11
    os.popen("cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }'")
IndentationError: unexpected indent

错误说明

在从0.1.6.6自动更新到0.1.6.7后,/configs/config.py被错误地修改了

hostip = os.popen("cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }'").read().replace("\n","")
    os.popen("cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }'")
    .read()
    .replace("\n", "")
)

这里出现了一个很奇怪的修改,更新前的代码和仓库中的代码不是这样的

HibiKier commented 1 year ago

嗯,已经修过了,你把config.py换一下就好了