运行环境安装 绘声绘影 后的一个错误 (MIME)
-
windows 下面跑的测试环境,今天突然报错了,
跟踪了半天发现是个小问题
注册表项目中 有了一个中文项,删除即可。这是安装 绘声绘影造成的
HKEY_CLASSES_ROOT\MIME\Database\Content Type
~~~~~~~~~~~~~~
Traceback (most recent call last):
File "D:\3lp\studio\OpenERP\source6.1\server\openerp-server", line 42, in <module>
import openerp
File "D:\3lp\studio\OpenERP\source6.1\server\openerp_init_.py", line 39, in <module>
import service
File "D:\3lp\studio\OpenERP\source6.1\server\openerp\service_init_.py", line 26, in <module>
import http_server
File "D:\3lp\studio\OpenERP\source6.1\server\openerp\service\http_server.py", line 49, in <module>
from websrv_lib import *
File "D:\3lp\studio\OpenERP\source6.1\server\openerp\service\websrv_lib.py", line 38, in <module>
from SimpleHTTPServer import SimpleHTTPRequestHandler
File "C:\Python27\lib\SimpleHTTPServer.py", line 27, in <module>
class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
File "C:\Python27\lib\SimpleHTTPServer.py", line 204, in SimpleHTTPRequestHandler
mimetypes.init() # try to read system mime.types
File "C:\Python27\lib\mimetypes.py", line 355, in init
db.read_windows_registry()
File "C:\Python27\lib\mimetypes.py", line 259, in read_windows_registry
for ctype in enum_types(mimedb):
File "C:\Python27\lib\mimetypes.py", line 249, in enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'utf8' codec can't decode byte 0xd0 in position 0: invalid continuation byte -
强人啊,连这个问题也被你给找出来了。
但,这基本上还是OpenERP的一个bug,因为windows中的中的中文是用cp936编码的,而OpenERP却想用utf-8来解码所以有这样的错误。