我正在尝试将数据转储到文件中,并不断收到此错误:
d:\django\mysite>manage.py dumpdata > alldata.json
Traceback (most recent call last):
File "D:\django\mysite\manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 443, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 241, in execute
self.stdout.write(output)
IOError: [Errno 9] Bad file descriptor
我觉得这与代码页或 unicode 有关。尝试在 PowerShell 中执行此操作,没有错误,但数据已打印到屏幕上并且文件为空......(好像 > 符号不存在)。
任何人都知道可能导致这种情况的原因吗?
提前致谢 :)