get_server_environment unstable

Bug #409791 reported by Nicolas Bessi - Camptocamp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenERP Ecuador
Invalid
Undecided
Unassigned

Bug Description

the function get_server_environment is unstable

First when it launches bzr it does not ensure that we are in a valide path.
Then the getdefaultlocale() can return none or crash so the join will not work in any case.

Here is a very little patch.

Greetings

Nicolas

castor:service nbessi$ bzr diff -r1773 web_services.py
=== modified file 'bin/service/web_services.py'
--- bin/service/web_services.py 2009-07-14 12:41:32 +0000
+++ bin/service/web_services.py 2009-08-06 10:21:35 +0000
@@ -531,8 +531,10 @@
             rev_id = os.popen('bzr revision-info').read()
         except Exception,e:
              rev_id = 'Exception: %s\n' % (str(e))
-
- os_lang = '.'.join(locale.getdefaultlocale())
+ try:
+ os_lang = '.'.join(locale.getdefaultlocale())
+ except Exception,e:
+ os_lang = 'Exception: %s\n' % (str(e))
         environment = '\nEnvironment Information : \n' \
                       'PlatForm : %s\n' \
                       'Operating System : %s\n' \

Changed in openerp-ec:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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