我有使用 Python 2.5 和 Python 2.7 的 GAE 项目。所以,我应该能够同时使用这两个版本。我已将 2 个版本安装到不同的文件夹(d:\Work\Python25\
和d:\Work\Python27\
)中。在它们之间切换最简单的方法是什么?
我试过使用:
start d:\Work\Python27\python.exe d:\Work\GAE\dev_appserver.py %~dp0
但如果失败并出现以下异常:
Traceback (most recent call last):
File "d:\Work\GAE\dev_appserver.py", line 171, in <module>
run_file(__file__, globals())
File "d:\Work\GAE\dev_appserver.py", line 167, in run_file
execfile(script_path, globals_)
File "d:\Work\GAE\google\appengine\tools\dev_appserver_main.py", line 165, in
<module>
from google.appengine.tools import dev_appserver
File "d:\Work\GAE\google\appengine\tools\dev_appserver.py", line 197, in <modu
le>
mimetypes.add_type(mime_type, '.' + ext)
File "d:\Work\Python27\lib\mimetypes.py", line 344, in add_type
init()
File "d:\Work\Python27\lib\mimetypes.py", line 355, in init
db.read_windows_registry()
File "d:\Work\Python27\lib\mimetypes.py", line 259, in read_windows_registry
for ctype in enum_types(mimedb):
File "d:\Work\Python27\lib\mimetypes.py", line 249, in enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal
not in range(128)