Index: trunk/ippToPsps/jython/batch.py
===================================================================
--- trunk/ippToPsps/jython/batch.py	(revision 33556)
+++ trunk/ippToPsps/jython/batch.py	(revision 33557)
@@ -262,7 +262,15 @@
 
         # clunky way to prettify XML
-        p = Popen("xmllint --format " + tmpPath + " > " + outPath, shell=True, stdout=PIPE)
-        p.wait()
-        os.remove(tmpPath)
+        try:
+            cmd = "xmllint --format " + tmpPath + " > " + outPath
+            p = Popen(cmd, shell=True, stdout=PIPE)
+            p.wait()
+        except:
+            self.logger.errorPair("Popen failed", cmd)
+            return False
+        finally: 
+            os.remove(tmpPath)
+
+        return True
 
 
@@ -528,11 +536,16 @@
                 self.logger.errorPair("Aborting this batch", "unable to export tables to FITS file")
             else:
-                self.writeBatchManifest()
-                if self.config.datastorePublishing: 
-                    # tar and zip ready for publication to datastore
-                    if self.tarAndZip():
-                        # now publish to the datastore
-                        tarballFile = Batch.getTarballFile(self.batchID)
-                        Batch.publishToDatastore(self.datastore, self.batchID, self.batchName, self.subDir, tarballFile)
+                if self.writeBatchManifest():
+                    if self.config.datastorePublishing: 
+                        # tar and zip ready for publication to datastore
+                        if self.tarAndZip():
+                            # now publish to the datastore
+                            tarballFile = Batch.getTarballFile(self.batchID)
+                            Batch.publishToDatastore(
+                                    self.datastore, 
+                                    self.batchID, 
+                                    self.batchName, 
+                                    self.subDir, 
+                                    tarballFile)
 
 from datastore import Datastore
