天天看点

获取session数据,使用upper报错AttributeError: ‘NoneType‘ object has no attribute ‘upper‘

获取session数据,使用upper报错AttributeError: ‘NoneType‘ object has no attribute ‘upper‘

编写接口时候,在获取验证码这个地方报错,一开始是疑惑为什么没有upper,后来才发现,是由于数据seession中根本没有vcode,也就是说,你要验证upper的值是None,其实就发现,这个字段是不存在的,是空的!无法对值进行upper操作,很多地方都会报该错误AttributeError: ‘NoneType’ object has no attribute ‘xxx’,检查是否是自己的逻辑或者数据有问题!