In the course of learning webpy, there are unicodedecodeerror: ' ASCII ' codec can ' t decode byte 0xe6 in position 29:ordinal No in range (128) error
After Baidu reference to the following article to resolve:
Http://blog.sina.com.cn/s/blog_6c39196501013s5b.html
Resolve Unicodedecodeerror: ' ASCII ' codec can ' t decode byte 0xe5 in position 108:ordinal not in Ran (2012-02-29 10:21:59) reprint label : Topics in Categories: Python
1. Problem Description: A timed update project that was written with Python in the Django Framework, tested correctly under Windows and tested on Linux and reported the following error:
ASCII codec can ' t decode byte 0xe8 in position 0:ordinal No in range (128)
2. Reason analysis: Character problem. Character issues are easy to come by when the Windows system is turning to a Linux system.
3. Workaround: Add the following three lines to the page where the problem occurs:
Import Sys
Reload (SYS)
Sys.setdefaultencoding (' Utf-8 ')