Problem of Unicode if root/addons path contains accented character(s).

Bug #563029 reported by Thierry (AJM)
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Status tracked in Trunk
5.0
Won't Fix
Low
Unassigned
Trunk
Fix Released
Low
OpenERP's Framework R&D

Bug Description

I have downloaded openerp on ubuntu 9.10 in French. I directly untar it in my "téléchargements" folder.

when i tried to start the server (without installing) directly from the bin (/home/user/Téléchargemetns/openerp-server-5.0.7/bin/opernerp-server.py).

The problem is when you run the client (same way). the server crash !

Moving to a folder without accented characters resolve the problem.

Related branches

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

Could you provide the traceback ?

Thanks

Changed in openobject-server:
status: New → Incomplete
milestone: none → 5.0.10
Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

Here is the traceback from my server

[2010-04-14 15:46:04,185] ERROR:web-services:[17]: Traceback (most recent call last):
[2010-04-14 15:46:04,185] ERROR:web-services:[18]: File "/home/stephane/Téléchargements/openerp-server-5.0.9/bin/service/web_services.py", line 97, in __call__
[2010-04-14 15:46:04,185] ERROR:web-services:[19]: update_module=True)[1]
[2010-04-14 15:46:04,185] ERROR:web-services:[20]: File "/home/stephane/Téléchargements/openerp-server-5.0.9/bin/pooler.py", line 62, in restart_pool
[2010-04-14 15:46:04,185] ERROR:web-services:[21]: return get_db_and_pool(db_name, force_demo, status, update_module=update_module)
[2010-04-14 15:46:04,185] ERROR:web-services:[22]: File "/home/stephane/Téléchargements/openerp-server-5.0.9/bin/pooler.py", line 40, in get_db_and_pool
[2010-04-14 15:46:04,185] ERROR:web-services:[23]: addons.load_modules(db, force_demo, status, update_module)
[2010-04-14 15:46:04,185] ERROR:web-services:[24]: File "/home/stephane/Téléchargements/openerp-server-5.0.9/bin/addons/__init__.py", line 700, in load_modules
[2010-04-14 15:46:04,186] ERROR:web-services:[25]: has_updates = load_module_graph(cr, graph, status, perform_checks=(not update_module), report=report)
[2010-04-14 15:46:04,186] ERROR:web-services:[26]: File "/home/stephane/Téléchargements/openerp-server-5.0.9/bin/addons/__init__.py", line 655, in load_module_graph
[2010-04-14 15:46:04,186] ERROR:web-services:[27]: modobj.update_translations(cr, 1, [mid], None)
[2010-04-14 15:46:04,186] ERROR:web-services:[28]: File "/home/stephane/Téléchargements/openerp-server-5.0.9/bin/addons/base/module/module.py", line 476, in update_translations
[2010-04-14 15:46:04,186] ERROR:web-services:[29]: modpath = addons.get_module_path(mod.name)
[2010-04-14 15:46:04,186] ERROR:web-services:[30]: File "/home/stephane/Téléchargements/openerp-server-5.0.9/bin/addons/__init__.py", line 157, in get_module_path
[2010-04-14 15:46:04,186] ERROR:web-services:[31]: if os.path.exists(opj(ad, module)) or os.path.exists(opj(ad, '%s.zip' % module)):
[2010-04-14 15:46:04,186] ERROR:web-services:[32]: File "/usr/lib/python2.6/posixpath.py", line 70, in join
[2010-04-14 15:46:04,186] ERROR:web-services:[33]: path += '/' + b

Changed in openobject-server:
status: Incomplete → Confirmed
Revision history for this message
xrg (xrg) wrote : Re: [Bug 563029] [NEW] can't start server from a folder wich name contains accented letters

On Wednesday 14 April 2010, you wrote:
> Public bug reported:
>
> I have downloaded openerp on ubuntu 9.10 in French. I directly untar it
> in my "téléchargements" folder.
>

I think it should be not safe nor easy to proof all the code for non-latin in
paths.

An alternative would be to symlink that directory of yours to a latin name. It
is easy and works around the problem perfectly.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote : Re: can't start server from a folder wich name contains accented letters

Hi guys,

I have investigated and came across a fact that this could have been called a problem in python,but however we can cover the problem by a little trick.

This has been a headache just due to os.path.join should use type unicode if it has accented characters.

I have attached 2 patches:
1. path_into_unicode : It uses system based encoding.
2. path_into_unicode1 : It uses locale based encoding.

These patches send unicode type of path to join() and this gets rid of the ugly traceback.

Interrupt me if I am missing something.

Thanks.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Here goes another.

Share your views.

Thanks.

summary: - can't start server from a folder wich name contains accented letters
+ Problem of Unicode if root/addons path contains accented character(s).
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Un-attaching the milestone.
Experts,would you please share a word?

Thanks.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

The fix was released in revision 3192 <email address hidden>
Thanks for reporting!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.