← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-client-web/6.0-bug-768973-xrg into lp:openobject-client-web/6.0

 

xrg has proposed merging lp:~openerp-dev/openobject-client-web/6.0-bug-768973-xrg into lp:openobject-client-web/6.0.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #768973 in OpenERP Web Client: "controllers, i18n: improve messages when things bork"
  https://bugs.launchpad.net/openobject-client-web/+bug/768973

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-bug-768973-xrg/+merge/58813
-- 
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-bug-768973-xrg/+merge/58813
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-client-web/6.0-bug-768973-xrg.
=== modified file 'openobject/controllers/_root.py'
--- openobject/controllers/_root.py	2011-01-11 16:55:41 +0000
+++ openobject/controllers/_root.py	2011-04-22 13:21:26 +0000
@@ -64,6 +64,8 @@
             cherrypy.engine.autoreload.unsubscribe()
         try:
             obj = pooler.get_pool().get_controller("/openerp/modules")
+            if not obj:
+                raise RuntimeError("Cannot find controller for /openerp/modules !")
             if obj.has_new_modules():
                 pooler.restart_pool()
         except AuthenticationError:

=== modified file 'openobject/i18n/_gettext.py'
--- openobject/i18n/_gettext.py	2011-01-26 14:35:45 +0000
+++ openobject/i18n/_gettext.py	2011-04-22 13:21:26 +0000
@@ -59,16 +59,20 @@
         try:
             # generate MO file if none exists or the MO file is older than the PO
             # file (== the PO file got updated since the cache was built)
+            cherrypy.log('Compiling message catalogs for %s' % popath, 'INFO')
             with open(popath, 'rb') as pofile:
                 with open(mopath, 'wb') as mofile:
                     babel.messages.mofile.write_mo(
                             mofile,
                             babel.messages.pofile.read_po(
                                     pofile, locale, domain))
-        except:
+        except Exception:
             # If the parsing of the PO file broke, don't leave an empty MO
             # file hanging around
-            os.remove(mopath)
+            cherrypy.log.error('Failed compilation of message catalog %s!' % popath)
+            if os.path.exists(mopath):
+                os.remove(mopath)
+            
             raise
 
     return babel.support.Translations.load(


Follow ups