【Django错误】OSError: raw write() returned invalid length 14 (should have been between 0 and 7)
错误环境
使用Django框架创建完models类的之后,用python manage.py migrate命令来生成数据库表的时候出错
错误代码
Operations to perform:
Apply all migrations: SMS, admin, auth, contenttypes, sessions
Running migrations:
Running migrations:
Traceback (most recent call last):
File "manage.py", line , in <module>
execute_from_command_line(sys.argv)
File "C:\python35\lib\site-packages\django\core\management\__init__.py", line , in execute_from_command_line
utility.execute()
File "C:\python35\lib\site-packages\django\core\management\__init__.py", line , in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\python35\lib\site-packages\django\core\management\base.py", line , in run_from_argv
self.execute(*args, **cmd_options)
self.execute(*args, **cmd_options)
File "C:\python35\lib\site-packages\django\core\management\base.py", line , in execute
output = self.handle(*args, **options)
File "C:\python35\lib\site-packages\django\core\management\commands\migrate.py", line , in handle
self.stdout.write(self.style.MIGRATE_HEADING("Running migrations:"))
File "C:\python35\lib\site-packages\django\core\management\base.py", line , in write
self._out.write(force_str(style_func(msg)))
OSError: raw write() returned invalid length (should have been between and )
错误原因
与win10系统、版本有关系
可能是unicode字符的返回值问题
解决办法
可以使用pip install win_unicode_console
安装win_unicode_console,在代码文件中添加以下两行代码解决:
import win_unicode_console
win_unicode_console.enable()
【Django错误】OSError: raw write() returned invalid length 14 (should have been between 0 and 7)的更多相关文章
- 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 ...
- 在python中使用print()时,raw write()返回无效的长度:OSError: raw write() returned invalid length 254 (should have been between 0 and 127)
写出一个不是code的bug,很烦恼,解决了挺长时间,都翻到外文来看,不过还是解决了,只尝试了一种简单可观的方法,希望对大家有用 我正在使用Django与Keras(tensorflow)来训练一个模 ...
- 在使用python语言的open函数时,提示错误OSError: [Errno 22] Invalid argument: ‘文件路径’
如题,在使用python语言的open函数时,提示错误OSError: [Errno 22] Invalid argument: '文件路径',在查阅了大量资料后也得到了一些解决方案,但是这些解决方案 ...
- oracle report err:REP-2103 PL/SQL formula returned invalid value or no value
好多年没用report builder做报表了,最近又开始接触这玩意了,今天修改一个report,调试半天没发现逻辑问题,一直报REP-2103: Column 'CF_report_line_po' ...
- myeclipse中导入js报如下错误Syntax error on token "Invalid Regular Expression Options", no accurate correc
今天在使用bootstrap的时候引入的js文件出现错误Syntax error on token "Invalid Regular Expression Options", no ...
- 第四百零五节,centos7下搭建sentry错误日志服务器,接收python以及Django错误,
第四百零五节,centos7下搭建sentry错误日志服务器,接收python以及Django错误, 注意:版本,不然会报错 Docker >=1.11Compose >1.6.0 通过d ...
- DJango错误日志生成
DJango错误日志生成 setting.py设置 LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': ...
- .NET读取Excel数据,提示错误:未在本地计算机上注册“Microsoft.ACE.OLEDB.12.0”提供程序
解决.NET读取Excel数据时,提示错误:未在本地计算机上注册“Microsoft.ACE.OLEDB.12.0”提供程序的操作: 1. 检查本机是否安装Office Access,如果未安装去去h ...
- .Net Core 控制台程序错误:Can not find runtime target for framework '.NETCoreApp,Version=v1.0' compatible with one of the target runtimes: 'win10-x64, win81-x64, win8-x64, win7-x64'.
.Net Core 控制台程序错误:Can not find runtime target for framework '.NETCoreApp,Version=v1.0' compatible wi ...
随机推荐
- sama5d3 环境检测 gpio--yk测试
说明: gpio的MAP关系 yk0--pioA7 yk1--pioA5 yk2--pioA9 yk3--pioA3 yk4--pioA1 yk5--pioA8 (端子从左--& ...
- Netty系列之Netty百万级推送服务设计要点(转)
1. 背景 1.1. 话题来源 最近很多从事移动互联网和物联网开发的同学给我发邮件或者微博私信我,咨询推送服务相关的问题.问题五花八门,在帮助大家答疑解惑的过程中,我也对问题进行了总结,大概可以归纳为 ...
- JQuery Show()的几种效果 总有一种是你需要的
1 show()方法和hide()方法 $("selector").show() 从display:none还原元素默认或已设置的display属性$("selecto ...
- imx6 MfgTool分析
解析freescale的MfgTool中的脚本,了解imx6, android系统的分区情况. 配置文件 1. cfg.ini [profiles] chip = MX6DL Linux Update ...
- OGNL(Object-Graph Navigation Language),可以方便地操作对象属性的开源表达式语言,使页面更简洁;
OGNL(Object-Graph Navigation Language),可以方便地操作对象属性的开源表达式语言,使页面更简洁: 支持运算符(如+-*/),比普通的标志具有更高的自由度和更强的功能 ...
- tinycore remaster方法
11.1. PrerequisitesYou need a Linux distribution with the required programs available:cpio, tar, gzi ...
- xampp默认项目文件夹htdocs
正确安装好XAMPP后,默认是必须将php程序放到 xampp\htdocs文件夹下才能运行但可以修改.. 参考:http://zhidao.baidu.com/link?url=sY_DPSeGBA ...
- 通过公网IP主机建立ssh隧道
环境描述 hostA: 有公网IP的linux主机 hostB: 私有路由器后端无公网IPlinux主机,能够ssh连接到hostA hostC: 个人pc机 隧道创建步骤 step1 在hostB上 ...
- linux下面bin,sbin不理解的查阅
在一下的文件中得到答案, 突然想想自己有点傻,自己有代码,为什么不自己查看一下代码呢 http://blog.csdn.net/ithomer/article/details/9839957
- hdu 1025:Constructing Roads In JGShining's Kingdom(DP + 二分优化)
Constructing Roads In JGShining's Kingdom Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65 ...