原文:python3.x运行的坑:AttributeError: 'str' object has no attribute 'decode'

在centos 中使用uwsgi启动django项目 项目连接mysql 在进行数据获取的时候报错如下 报错信息 解决方法 找到报错行,将其注释掉 ...

2020-05-28 17:22 0 970 推荐指数:

查看详情

AttributeError: 'str' object has no attribute 'decode'

python3下列代码会报上边的错 print("Response:", resp.text.decode('unicode_escape'))解决办法:print("Response:", resp.text.encode('utf-8').decode('unicode_escape ...

Mon Aug 10 18:23:00 CST 2020 0 888
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM