common/i18n.py
branch3.5
changeset 3119 819aea456251
parent 3118 9e7a155bc4e5
child 3156 cd56d5c379cb
child 3202 241ae91e9ab7
--- a/common/i18n.py	Tue Sep 08 15:30:49 2009 +0200
+++ b/common/i18n.py	Tue Sep 08 15:59:20 2009 +0200
@@ -44,9 +44,10 @@
     status != 0
     """
     print cmd.replace(os.getcwd() + os.sep, '')
-    status = os.system(cmd)
+    from subprocess import call
+    status = call(cmd)
     if status != 0:
-        raise Exception()
+        raise Exception('status = %s' % status)
 
 
 def available_catalogs(i18ndir=None):
@@ -74,15 +75,15 @@
         mergedpo = join(destdir, '%s_merged.po' % lang)
         try:
             # merge instance/cubes messages catalogs with the stdlib's one
-            execute('msgcat --use-first --sort-output --strict %s > %s'
-                    % (' '.join(pofiles), mergedpo))
-            # make sure the .mo file is writeable and compile with *msgfmt*
+            execute('msgcat --use-first --sort-output --strict -o "%s" %s'
+                    % (mergedpo, ' '.join('"%s"' % f for f in pofiles)))
+            # make sure the .mo file is writeable and compiles with *msgfmt*
             applmo = join(destdir, lang, 'LC_MESSAGES', 'cubicweb.mo')
             try:
                 ensure_fs_mode(applmo)
             except OSError:
                 pass # suppose not exists
-            execute('msgfmt %s -o %s' % (mergedpo, applmo))
+            execute('msgfmt "%s" -o "%s"' % (mergedpo, applmo))
         except Exception, ex:
             errors.append('while handling language %s: %s' % (lang, ex))
         try: