python – NoneType和str的不支持的操作数类型

我收到一条消息说:

Traceback (most recent call last):
 File "/var/www/fosa/error_supressor.py", line 46, in <module>
   sys.stderr.write(latest + '\n')
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

我已经试图解决这个问题好几天了,但说实话,我是一个多才多艺的程序员.
因此,让我们排队问题,看看是否有一个耐心的人可以节省一些时间来解决一个谦虚的陌生人的问题:-)

除此之外,当我检查我的错误日志时,我发现此错误消息,我怀疑是相关的:

File "/var/www/fosa/app/controllers/client/client.py", line 601, in detail
    if not course.bookable or not course.school.partner.active: # both objects are boolean 
AttributeError: 'NoneType' object has no attribute 'bookable'

最佳答案 >有些东西是绑定无最新的.弄清楚它是什么并修复你的逻辑错误.

>有些东西是无约束力的.图等

点赞