烧瓶UnicodeDecodeError:'utf-8'编解码器无法解码位置0的字节0xb3:无效的起始字节 [英] flask UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb3 in position 0: invalid start byte
本文介绍了烧瓶UnicodeDecodeError:'utf-8'编解码器无法解码位置0的字节0xb3:无效的起始字节的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在学习烧瓶模块我复制了代码,但没有用,并给了我UnicodeDecodeError
感谢您的帮助
解决方案
正如回溯指出的那样,您计算机的主机名具有非ASCII字符.正如
I'm learning the flask module I copy the code but it didn't work and give my the UnicodeDecodeError
Thanks for your help
解决方案
As the traceback point out, your computer's hostname has non-ASCII character. As this document said, you can use this way to get your hostname:
$ python
>>> from socket import *
>>> getnameinfo(("127.0.0.1", 0), 0)
('user-greyli', '0') # here the 'user-greyli' is hostname
In windows system, the hostname was same as computer's name. So, you need to rename your computer's name.
How to do it? Just check this page. Besides, as a bonus, I capture a picture in Chinese that includes all the operation you need :)
这篇关于烧瓶UnicodeDecodeError:'utf-8'编解码器无法解码位置0的字节0xb3:无效的起始字节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文