Index: /main/waeup.sirp/trunk/src/waeup/sirp/image/image.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/image/image.py	(revision 6311)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/image/image.py	(revision 6312)
@@ -32,5 +32,10 @@
     """A file prepared for storing image files.
 
-    This file type is built upon :class:`hurry.file.HurryFile`.
+    This file type is built upon :class:`hurry.file.HurryFile`. It
+    stores the file contents given by `data` in a ZODB Blob.
+
+    The `filename` passed can be retrieved later as the `filename`
+    attribute although the contents of this parameter makes no
+    difference for us.
     """
     implements(IWAeUPImageFile)
@@ -41,11 +46,35 @@
         self.headers = {}
 
+    def __del__(self):
+        """Remove the real filesystem file bound to the blob.
+
+        Blob content is initially written to some real filesystem
+        file. This file might linger around in temporary dirs when
+        :class:`WAeUPImageFile` instances are created without storing
+        them in ZODB afterwards. This often happens in tests.
+
+        We remove that file too when we are about to be deleted.
+        """
+        if self._p_oid is not None or self._file._p_oid is not None:
+            # Don't mess up internal ZODB structure
+            return
+        f = self._file.open('r')
+        name = getattr(f, 'name', None)
+        f.close()
+        if name is not None and os.path.exists(name) and os.path.isfile(name):
+            os.unlink(name)
+        return
+
     def _getFile(self):
         return self._file.open('r')
 
+    #: A Python file-object already openend for reading containing the
+    #: stored file.
     file = property(_getFile)
 
     @property
     def size(self):
+        """The size of the stored file in bytes.
+        """
         f = self._file.open('r')
         size = int(os.fstat(f.fileno()).st_size)
@@ -55,4 +84,6 @@
     @property
     def data(self):
+        """The contents of the stored file.
+        """
         f = self._file.open('r')
         result = f.read()
