我在任何地方都找不到这个退出代码,但希望你们中的一个可以帮助我,或者让我知道这是否是 python/Django 中的错误。
无论如何,首先是堆栈跟踪:
Traceback (most recent call last):
File "C:\Sitezooi\SiteTest\manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Program Files\Python\lib\site-packages\django\core\management\__init_
_.py", line 385, in execute_from_command_line
utility.execute()
File "C:\Program Files\Python\lib\site-packages\django\core\management\__init_
_.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Program Files\Python\lib\site-packages\django\core\management\base.py
", line 288, in run_from_argv
self.execute(*args, **options.__dict__)
File "C:\Program Files\Python\lib\site-packages\django\core\management\base.py
", line 338, in execute
output = self.handle(*args, **options)
File "C:\Program Files\Python\lib\site-packages\django\core\management\command
s\runserver.py", line 83, in handle
self.run(*args, **options)
File "C:\Program Files\Python\lib\site-packages\django\core\management\command
s\runserver.py", line 92, in run
autoreload.main(self.inner_run, args, options)
File "C:\Program Files\Python\lib\site-packages\django\utils\autoreload.py", l
ine 322, in main
reloader(wrapped_main_func, args, kwargs)
File "C:\Program Files\Python\lib\site-packages\django\utils\autoreload.py", l
ine 293, in python_reloader
exit_code = restart_with_reloader()
File "C:\Program Files\Python\lib\site-packages\django\utils\autoreload.py", l
ine 279, in restart_with_reloader
exit_code = os.spawnve(os.P_WAIT, sys.executable, args, new_environ)
UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: inval
id character
请忽略奇怪的文件路径,我什至只是尝试将它直接放在 C:\ 上。
这里还有另一个可能类似的 Stackoverflow 问题:UnicodeEncodeError when using the compile function但它不像我使用的文件路径使用任何非英文字符。我在那里尝试了几个解决方案,但没有奏效。
运行之前在 2.7.x 中测试过的 python 3.4.1 也不起作用。在 linux(Ubuntu)上运行良好。
django 项目没有什么特别之处,因为它只是一个空的 startproject 项目。