Python TypeError:'bool'对象不可调用[重复]

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python TypeError:'bool'对象不可调用[重复]相关的知识,希望对你有一定的参考价值。

我如何解决这个问题。它是在脚本即时使用或它在Python.Im使用Debian OS并尝试安装此代码https://github.com/rkubik/paypark

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 2309, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 2295, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1741, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/var/paypark/paypark/frontend/auth.py", line 14, in auth_login
    if current_user.is_authenticated() or form.validate_on_submit():
TypeError: 'bool' object is not callable
答案

我同意Artyer的观点。当方法更改为属性或反之亦然时会发生这种python问题,但并非所有调用代码都已经过验证并更改为匹配。我猜测它的Flask-Login已被更改,但您正在使用的代码的作者已经指出了2年没有更新任何内容。 current_user.is_authenticate()是最可能的原因,一些挖掘,但改变两者或两者很快就会看到。您也可以找到其他实例。

以上是关于Python TypeError:'bool'对象不可调用[重复]的主要内容,如果未能解决你的问题,请参考以下文章

2. python提示:TypeError: unhashable type: 'list'

python: "TypeError: 'type' object is not subscriptable"

Python TypeError:'bool'对象不可调用[重复]

TypeError:使用Python Click库无法调用'str'对象

Python_报错:TypeError: file must have 'read' and 'readline' attributes

Python : TypeError: 'int' object is not iterable