<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -246,7 +246,7 @@
    instead of throwing ugly IOExceptions or confusing errors.
 - [ ] cd2track
 - [ ] cd2xmcd
-- [ ] coverdump
+- [X] coverdump
 - [ ] editxmcd
 - [ ] record2track
 - [ ] track2cd</diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -92,6 +92,7 @@ if (__name__ == '__main__'):
                     f.close()
                     msg.info(msg.filename(output_filename))
                 except IOError,e:
-                    msg.error(unicode(e))
+                    msg.error(_(u&quot;Unable to write \&quot;%s\&quot;&quot;) % \
+                                  msg.filename(output_filename))
                     sys.exit(1)
 </diff>
      <filename>coverdump</filename>
    </modified>
    <modified>
      <diff>@@ -1440,6 +1440,32 @@ class TestAiffAudio(TestTextOutput):
                 os.unlink(p)
             os.rmdir(undo_db_dir)
 
+    @TEST_EXECUTABLE
+    def test_coverdump_invalid(self):
+        track_file = tempfile.NamedTemporaryFile(
+            suffix=&quot;.&quot; + self.audio_class.SUFFIX)
+        temp_dir = tempfile.mkdtemp()
+        temp_dir_stat = os.stat(temp_dir)[0]
+        try:
+            track = self.audio_class.from_pcm(track_file.name,
+                                              BLANK_PCM_Reader(5))
+            track.set_metadata(DummyMetaData3())
+            if ((track.get_metadata() is not None) and
+                (len(track.get_metadata().images()) == 1)):
+                os.chmod(temp_dir,temp_dir_stat &amp; 0x7555)
+                self.assertEqual(self.__run_app__(
+                        [&quot;coverdump&quot;,&quot;-d&quot;,temp_dir,track.filename]),1)
+                self.__check_error__(_(u&quot;Unable to write \&quot;%s\&quot;&quot;) % \
+                                         (self.filename(
+                            os.path.join(temp_dir,&quot;front_cover.jpg&quot;))))
+        finally:
+            track_file.close()
+            os.chmod(temp_dir,temp_dir_stat)
+            for p in [os.path.join(temp_dir,f) for f in
+                      os.listdir(temp_dir)]:
+                os.unlink(p)
+            os.rmdir(temp_dir)
+
     #tests the splitting and concatenating programs
     @TEST_EXECUTABLE
     @TEST_CUESHEET</diff>
      <filename>test/test.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>89cf6ac0603173494e1f6ad9e3b2ae085004a075</id>
    </parent>
  </parents>
  <author>
    <name>Brian Langenberger</name>
    <email>bjl@usa.net</email>
  </author>
  <url>http://github.com/tuffy/python-audio-tools/commit/da90bc2a2636057556e938aa532c8d5fd5628a0a</url>
  <id>da90bc2a2636057556e938aa532c8d5fd5628a0a</id>
  <committed-date>2009-07-13T10:13:03-07:00</committed-date>
  <authored-date>2009-07-13T10:13:03-07:00</authored-date>
  <message>Update coverdump with error unit tests.</message>
  <tree>7f06b15b574abf02f7a5eee114a830bd6e9a95e2</tree>
  <committer>
    <name>Brian Langenberger</name>
    <email>bjl@usa.net</email>
  </committer>
</commit>
