Odoo中文社区可以通过以下三个域名访问:shine-it.net , odoocn.org,odoo.net.cn

原论坛用户的基本信息和发帖这里都予以保留,请注意:原论坛用户无需重新注册新用户,但是您的密码需要重置

开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

如果您登录系统碰到问题,请在微信公众号留言:

求助: 操作模块出现UnicodeDecodeError



  • 大家好, 初来乍到就碰到了不小的问题:<br />我在ubuntu server 10.04上装了openerp server 和 web 5.0.10, 用win7的客户端去连接. 一切都很顺利, 直到进入模块列表Modules时, 客户端出现了以下错误:<br /><br /><br />Environment Information : <br />System : Windows-32bit<br />OS Name : nt<br />Operating System Release : <br />Operating System Version : 32bit<br />Operating System Architecture : 32bit<br />Operating System Locale : zh_CN.cp936<br />Python Version : 2.5.2<br />OpenERP-Client Version : 5.0.10<br />Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):<br />  File "/root/erp/openerp-server-5.0.10/bin/netsvc.py", line 245, in dispatch<br />    result = LocalService(service_name)(method, *params)<br />  File "/root/erp/openerp-server-5.0.10/bin/netsvc.py", line 74, in call<br />    return getattr(self, method)(*params)<br />  File "/root/erp/openerp-server-5.0.10/bin/service/web_services.py", line 576, in execute<br />    res = service.execute(db, uid, object, method, *args)<br />  File "/root/erp/openerp-server-5.0.10/bin/osv/osv.py", line 58, in wrapper<br />    return f(self, dbname, *args, **kwargs)<br />  File "/root/erp/openerp-server-5.0.10/bin/osv/osv.py", line 119, in execute<br />    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)<br />  File "/root/erp/openerp-server-5.0.10/bin/osv/osv.py", line 111, in execute_cr<br />    return getattr(object, method)(cr, uid, *args, **kw)<br />  File "/root/erp/openerp-server-5.0.10/bin/osv/orm.py", line 2225, in read<br />    result = self._read_flat(cr, user, select, fields, context, load)<br />  File "/root/erp/openerp-server-5.0.10/bin/osv/orm.py", line 2297, in _read_flat<br />    res.extend(cr.dictfetchall())<br />  File "/usr/lib/python2.6/dist-packages/psycopg2/psycopg1.py", line 83, in dictfetchall<br />    rows = _2cursor.fetchall(self)<br />UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 25: ordinal not in range(128)<br /><br />服务器端的报错如下:<br />sh: bzr: not found<br />No LSB modules are available.<br />[2010-06-09 15:33:35,323] ERROR:web-services:[01]: <br />[2010-06-09 15:33:35,323] ERROR:web-services:[02]: Environment Information : <br />[2010-06-09 15:33:35,323] ERROR:web-services:[03]: System : Linux-2.6.32-22-generic-pae-i686-with-Ubuntu-10.04-lucid<br />[2010-06-09 15:33:35,323] ERROR:web-services:[04]: OS Name : posix<br />[2010-06-09 15:33:35,323] ERROR:web-services:[05]: Distributor ID:      Ubuntu<br />[2010-06-09 15:33:35,324] ERROR:web-services:[06]: Description: Ubuntu 10.04 LTS<br />[2010-06-09 15:33:35,324] ERROR:web-services:[07]: Release:    10.04<br />[2010-06-09 15:33:35,324] ERROR:web-services:[08]: Codename:    lucid<br />[2010-06-09 15:33:35,324] ERROR:web-services:[09]: Operating System Release : 2.6.32-22-generic-pae<br />[2010-06-09 15:33:35,324] ERROR:web-services:[10]: Operating System Version : #33-Ubuntu SMP Wed Apr 28 14:57:29 UTC 2010<br />[2010-06-09 15:33:35,324] ERROR:web-services:[11]: Operating System Architecture : 32bit<br />[2010-06-09 15:33:35,324] ERROR:web-services:[12]: Operating System Locale : zh_CN.UTF8<br />[2010-06-09 15:33:35,325] ERROR:web-services:[13]: Python Version : 2.6.5<br />[2010-06-09 15:33:35,325] ERROR:web-services:[14]: OpenERP-Server Version : 5.0.10<br />[2010-06-09 15:33:35,325] ERROR:web-services:[15]: Last revision No. & ID : <br />[2010-06-09 15:33:35,325] ERROR:web-services:[16]: Traceback (most recent call last):<br />[2010-06-09 15:33:35,325] ERROR:web-services:[17]:  File "/root/erp/openerp-server-5.0.10/bin/osv/osv.py", line 58, in wrapper<br />[2010-06-09 15:33:35,325] ERROR:web-services:[18]:    return f(self, dbname, *args, **kwargs)<br />[2010-06-09 15:33:35,325] ERROR:web-services:[19]:  File "/root/erp/openerp-server-5.0.10/bin/osv/osv.py", line 119, in execute<br />[2010-06-09 15:33:35,326] ERROR:web-services:[20]:    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)<br />[2010-06-09 15:33:35,326] ERROR:web-services:[21]:  File "/root/erp/openerp-server-5.0.10/bin/osv/osv.py", line 111, in execute_cr<br />[2010-06-09 15:33:35,326] ERROR:web-services:[22]:    return getattr(object, method)(cr, uid, *args, **kw)<br />[2010-06-09 15:33:35,326] ERROR:web-services:[23]:  File "/root/erp/openerp-server-5.0.10/bin/osv/orm.py", line 2225, in read<br />[2010-06-09 15:33:35,326] ERROR:web-services:[24]:    result = self._read_flat(cr, user, select, fields, context, load)<br />[2010-06-09 15:33:35,326] ERROR:web-services:[25]:  File "/root/erp/openerp-server-5.0.10/bin/osv/orm.py", line 2297, in _read_flat<br />[2010-06-09 15:33:35,327] ERROR:web-services:[26]:    res.extend(cr.dictfetchall())<br />[2010-06-09 15:33:35,327] ERROR:web-services:[27]:  File "/usr/lib/python2.6/dist-packages/psycopg2/psycopg1.py", line 83, in dictfetchall<br />[2010-06-09 15:33:35,327] ERROR:web-services:[28]:    rows = _2cursor.fetchall(self)<br />[2010-06-09 15:33:35,327] ERROR:web-services:[29]: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 25: ordinal not in range(128)<br /><br />一开始以为是python版本的问题, 后来被排除了. 在网上找了很久, 发现有类似的问题, 但没有解决的方法.<br />不知道是不是服务器字符集和客户端字符集不一致产生的问题? 但在web客户端下问题依然存在.<br />不知道大家有没有遇到过类似的情况, 又是如何解决的?



  • 大家好, 初来乍到就碰到了不小的问题:<br />我在ubuntu server 10.04上装了openerp server 和 web 5.0.10, 用win7的客户端去连接. 一切都很顺利, 直到进入模块列表Modules时, 客户端出现了以下错误:<br /><br /><br />Environment Information : <br />System : Windows-32bit<br />OS Name : nt<br />Operating System Release : <br />Operating System Version : 32bit<br />Operating System Architecture : 32bit<br />Operating System Locale : zh_CN.cp936<br />Python Version : 2.5.2<br />OpenERP-Client Version : 5.0.10<br />Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):<br />  File "/root/erp/openerp-server-5.0.10/bin/netsvc.py", line 245, in dispatch<br />    result = LocalService(service_name)(method, *params)<br />  File "/root/erp/openerp-server-5.0.10/bin/netsvc.py", line 74, in call<br />    return getattr(self, method)(*params)<br />  File "/root/erp/openerp-server-5.0.10/bin/service/web_services.py", line 576, in execute<br />    res = service.execute(db, uid, object, method, *args)<br />  File "/root/erp/openerp-server-5.0.10/bin/osv/osv.py", line 58, in wrapper<br />    return f(self, dbname, *args, **kwargs)<br />  File "/root/erp/openerp-server-5.0.10/bin/osv/osv.py", line 119, in execute<br />    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)<br />  File "/root/erp/openerp-server-5.0.10/bin/osv/osv.py", line 111, in execute_cr<br />    return getattr(object, method)(cr, uid, *args, **kw)<br />  File "/root/erp/openerp-server-5.0.10/bin/osv/orm.py", line 2225, in read<br />    result = self._read_flat(cr, user, select, fields, context, load)<br />  File "/root/erp/openerp-server-5.0.10/bin/osv/orm.py", line 2297, in _read_flat<br />    res.extend(cr.dictfetchall())<br />  File "/usr/lib/python2.6/dist-packages/psycopg2/psycopg1.py", line 83, in dictfetchall<br />    rows = _2cursor.fetchall(self)<br />UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 25: ordinal not in range(128)<br /><br />服务器端的报错如下:<br />sh: bzr: not found<br />No LSB modules are available.<br />[2010-06-09 15:33:35,323] ERROR:web-services:[01]: <br />[2010-06-09 15:33:35,323] ERROR:web-services:[02]: Environment Information : <br />[2010-06-09 15:33:35,323] ERROR:web-services:[03]: System : Linux-2.6.32-22-generic-pae-i686-with-Ubuntu-10.04-lucid<br />[2010-06-09 15:33:35,323] ERROR:web-services:[04]: OS Name : posix<br />[2010-06-09 15:33:35,323] ERROR:web-services:[05]: Distributor ID:      Ubuntu<br />[2010-06-09 15:33:35,324] ERROR:web-services:[06]: Description: Ubuntu 10.04 LTS<br />[2010-06-09 15:33:35,324] ERROR:web-services:[07]: Release:    10.04<br />[2010-06-09 15:33:35,324] ERROR:web-services:[08]: Codename:    lucid<br />[2010-06-09 15:33:35,324] ERROR:web-services:[09]: Operating System Release : 2.6.32-22-generic-pae<br />[2010-06-09 15:33:35,324] ERROR:web-services:[10]: Operating System Version : #33-Ubuntu SMP Wed Apr 28 14:57:29 UTC 2010<br />[2010-06-09 15:33:35,324] ERROR:web-services:[11]: Operating System Architecture : 32bit<br />[2010-06-09 15:33:35,324] ERROR:web-services:[12]: Operating System Locale : zh_CN.UTF8<br />[2010-06-09 15:33:35,325] ERROR:web-services:[13]: Python Version : 2.6.5<br />[2010-06-09 15:33:35,325] ERROR:web-services:[14]: OpenERP-Server Version : 5.0.10<br />[2010-06-09 15:33:35,325] ERROR:web-services:[15]: Last revision No. & ID : <br />[2010-06-09 15:33:35,325] ERROR:web-services:[16]: Traceback (most recent call last):<br />[2010-06-09 15:33:35,325] ERROR:web-services:[17]:  File "/root/erp/openerp-server-5.0.10/bin/osv/osv.py", line 58, in wrapper<br />[2010-06-09 15:33:35,325] ERROR:web-services:[18]:    return f(self, dbname, *args, **kwargs)<br />[2010-06-09 15:33:35,325] ERROR:web-services:[19]:  File "/root/erp/openerp-server-5.0.10/bin/osv/osv.py", line 119, in execute<br />[2010-06-09 15:33:35,326] ERROR:web-services:[20]:    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)<br />[2010-06-09 15:33:35,326] ERROR:web-services:[21]:  File "/root/erp/openerp-server-5.0.10/bin/osv/osv.py", line 111, in execute_cr<br />[2010-06-09 15:33:35,326] ERROR:web-services:[22]:    return getattr(object, method)(cr, uid, *args, **kw)<br />[2010-06-09 15:33:35,326] ERROR:web-services:[23]:  File "/root/erp/openerp-server-5.0.10/bin/osv/orm.py", line 2225, in read<br />[2010-06-09 15:33:35,326] ERROR:web-services:[24]:    result = self._read_flat(cr, user, select, fields, context, load)<br />[2010-06-09 15:33:35,326] ERROR:web-services:[25]:  File "/root/erp/openerp-server-5.0.10/bin/osv/orm.py", line 2297, in _read_flat<br />[2010-06-09 15:33:35,327] ERROR:web-services:[26]:    res.extend(cr.dictfetchall())<br />[2010-06-09 15:33:35,327] ERROR:web-services:[27]:  File "/usr/lib/python2.6/dist-packages/psycopg2/psycopg1.py", line 83, in dictfetchall<br />[2010-06-09 15:33:35,327] ERROR:web-services:[28]:    rows = _2cursor.fetchall(self)<br />[2010-06-09 15:33:35,327] ERROR:web-services:[29]: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 25: ordinal not in range(128)<br /><br />一开始以为是python版本的问题, 后来被排除了. 在网上找了很久, 发现有类似的问题, 但没有解决的方法.<br />不知道是不是服务器字符集和客户端字符集不一致产生的问题? 但在web客户端下问题依然存在.<br />不知道大家有没有遇到过类似的情况, 又是如何解决的?


  • 管理员

    给出的错误信息不足以定位错误所在。<br />UnicodeDecodeError 一般发生在字节码编码字符串转换为Unicode字符串时未提供字节码编码字符串的编码方式,Python因此使用了默认的ASCII编码来解码非ASCII编码字符串造成的。<br /><br />在英文界面下会有相同的错误吗?



  • 我用的都是英文的, 没有换过语言包. 应该不会出现转码问题, 所以才感到很费解.<br />我已经反复确定了安装过程, 没有发现任何错误.<br />Errrorlog里也没有给出更多的信息.



  • 问题找到了!<br />是数据库编码的问题!<br />postgres的默认编码是sql_ascii. 在创建数据库时要选择utf8字符集. <br />但在phppgadmin中创建的话, 会出现utf8不被兼容的错误. 解决办法是, 进入shell切换到postgres, 然后$ createdb -O user -E UTF8 -T template0 mydb<br />这应该是很常见的问题, 但oe官方的doc和论坛里都没有提及, 真是奇怪. <br />



  • 在phppgadmin中创建,为什么呢?<br />openerp客户端本身可以调用创建数据库的命令啊,何必自己去创建呢?


登录后回复
 

与 Odoo 中文社区 的连接断开,我们正在尝试重连,请耐心等待