'str' object has no attribute 'expand'
时间: 2023-09-06 08:09:08 浏览: 62
根据您提供的引用内容,"str"对象没有属性"expand"的错误是因为在Python中,字符串对象没有名为"expand"的属性。这个错误通常发生在试图调用字符串对象上不存在的方法或属性时。请检查您的代码,确认您是否正确地使用了字符串对象,并查看您是否意外地将其他类型的对象分配给了字符串变量。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [已解决AttributeError: ‘str‘ object has no attribute ‘decode‘异常的正确解决方法,亲测有效!...](https://blog.csdn.net/weixin_50843918/article/details/129741081)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [完美解决 AttributeError: ‘str‘ object has no attribute ‘decode](https://blog.csdn.net/weixin_41194129/article/details/125161714)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]