[SCM] morituri/master: * morituri/program/cdrdao.py: Wrap read in an exception handler. * morituri/common/task.py: Debug exceptions more.

js at users.alioth.debian.org js at users.alioth.debian.org
Sun Oct 19 20:09:11 UTC 2014


The following commit has been merged in the master branch:
commit d30eb59a666c1ded0df171ee6cdee19f075bfd47
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Fri Sep 11 15:41:51 2009 +0000

    	* morituri/program/cdrdao.py:
    	  Wrap read in an exception handler.
    	* morituri/common/task.py:
    	  Debug exceptions more.

diff --git a/ChangeLog b/ChangeLog
index 85dc4f5..8dc94bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2009-09-11  Thomas Vander Stichele  <thomas at apestaart dot org>
 
+	* morituri/program/cdrdao.py:
+	  Wrap read in an exception handler.
+	* morituri/common/task.py:
+	  Debug exceptions more.
+
+2009-09-11  Thomas Vander Stichele  <thomas at apestaart dot org>
+
 	* HACKING:
 	  Note unicode handling.
 	* morituri/test/test_image_image.py:
diff --git a/morituri/common/task.py b/morituri/common/task.py
index 2f233d7..a4d9dbc 100644
--- a/morituri/common/task.py
+++ b/morituri/common/task.py
@@ -345,8 +345,8 @@ class SyncRunner(TaskRunner, ITaskListener):
         self.debug('done running task %r', task)
         if task.exception:
             # FIXME: this gave a traceback in the logging module
-            #self.debug('raising exception, %r',
-            #    log.getExceptionMessage(self._task.exception))
+            self.debug('raising exception, %r',
+                log.getExceptionMessage(task.exception))
             raise task.exception
 
     def _startWrap(self, task):
@@ -355,6 +355,8 @@ class SyncRunner(TaskRunner, ITaskListener):
         try:
             task.start(self)
         except Exception, e:
+            self.debug('exception during start: %r',
+                log.getExceptionMessage(e))
             task.exception = e
             self.stopped(task)
 
diff --git a/morituri/program/cdrdao.py b/morituri/program/cdrdao.py
index 24575df..74cdabf 100644
--- a/morituri/program/cdrdao.py
+++ b/morituri/program/cdrdao.py
@@ -260,24 +260,31 @@ class CDRDAOTask(task.Task):
         self.runner.schedule(1.0, self._read, runner)
 
     def _read(self, runner):
-        ret = self._popen.recv()
+        try:
+            ret = self._popen.recv()
 
-        if ret:
-            self.log("read from stdout: %s", ret)
-            self.readbytesout(ret)
+            if ret:
+                self.log("read from stdout: %s", ret)
+                self.readbytesout(ret)
 
-        ret = self._popen.recv_err()
+            ret = self._popen.recv_err()
 
-        if ret:
-            self.log("read from stderr: %s", ret)
-            self.readbyteserr(ret)
+            if ret:
+                self.log("read from stderr: %s", ret)
+                self.readbyteserr(ret)
 
-        if self._popen.poll() is None:
-            # not finished yet
-            self.runner.schedule(1.0, self._read, runner)
-            return
+            if self._popen.poll() is None:
+                # not finished yet
+                self.runner.schedule(1.0, self._read, runner)
+                return
 
-        self._done()
+            self._done()
+        except Exception, e:
+            self.debug('exception during _read()')
+            self.debug(log.getExceptionMessage(e))
+            import code; code.interact(local=locals())
+            self.exception = e
+            self.stop()
 
     def _done(self):
             self.debug('Return code was %d', self._popen.returncode)

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list