python3----异常处理----AttributeError: ‘str‘ object has no attribute ‘copy‘
本文主要是介绍python3----异常处理----AttributeError: ‘str‘ object has no attribute ‘copy‘,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
文章目录
1.异常情况如下:
2.代码情况如下:
3.解决方法:
1.异常情况如下:
使用flask_sqlalchemy中,设置数据库模型类的时候报的错误
模型类去继承某个抽象类的时候
File "D:\TestSoftware\Python2.7.13\lib\site-packages\sqlalchemy\orm\decl_base.py", line 628, in _produce_column_copies
column_copies[obj] = copy_ = obj._copy()
File "D:\TestSoftware\Python2.7.13\lib\site-packages\sqlalchemy\sql\schema.py", line 1911, in _copy
return self._schema_item_copy(c)
File "D:\TestSoftware\Python2.7.13\lib\site-packages\sqlalchemy\sql\schema.py", line 153, in _schema_item_copy
schema_item.info = self.info.copy()
AttributeError: 'str' object has no attribute 'copy'