Django报错:OSError: raw write() returned invalid length 4 (should have been between 0 and 2)
在使用Django时Django报错:Django报错:OSError: raw write() returned invalid length 4 (should have been between 0 and 2),之前是没有问题的,于是百度原因和解决办法,最终有大神分析可能与win10系统的新版本有关系,是字符编码的问题。
解决方案:
1.在dos终端使用 pip install win_unicode_console安装win_unicode_console;
2.在wiew.py插入下边两行代码:
1 import win_unicode_console 2 win_unicode_console.enable()