最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

server - TypeError in Apache Status Script: expected string or bytes-like object, got 'bool' - Stack Overflow

programmeradmin0浏览0评论

I'm working with a script that retrieves Apache server status using Python on Ubuntu 22.04 with Python 3.12.3. The script runs inside the BTPanel environment and encounters this error:

TypeError: expected string or bytes-like object, got 'bool'

The error is showing as such:

File "/www/server/panel/BTPanel/__init__.py", line 2683, in publicObject
    return run_exec().run(toObject, defs, get)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/www/server/panel/BTPanel/__init__.py", line 2629, in run
    result = getattr(toObject, get.action)(get)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/www/server/panel/class/ajax.py", line 17, in GetApacheStatus
    return a.GetApacheStatus()
           ^^^^^^^^^^^^^^^^^^^
  File "/www/server/panel/class/apache.py", line 55, in GetApacheStatus
    Uptime = re.search(r"ServerUptimeSeconds:\s+(.*)",result)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/www/server/panel/pyenv/lib/python3.12/re/__init__.py", line 177, in search
    return _compile(pattern, flags).search(string)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got 'bool'


Why do this show like this and how to solve this?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论