[Checkins] SVN: z3c.filetype/trunk/src/z3c/filetype/ Fix some tests on windows, not sure if this works at all.

Roger Ineichen roger at projekt01.ch
Thu Sep 7 17:51:10 EDT 2006


Log message for revision 70037:
  Fix some tests on windows, not sure if this works at all.
  
  Dobee,
  Please double check this.
  

Changed:
  U   z3c.filetype/trunk/src/z3c/filetype/README.txt
  U   z3c.filetype/trunk/src/z3c/filetype/magic.py
  _U  z3c.filetype/trunk/src/z3c/filetype/testdata/IMG_0504.JPG
  _U  z3c.filetype/trunk/src/z3c/filetype/testdata/test.flv

-=-
Modified: z3c.filetype/trunk/src/z3c/filetype/README.txt
===================================================================
--- z3c.filetype/trunk/src/z3c/filetype/README.txt	2006-09-07 21:39:12 UTC (rev 70036)
+++ z3c.filetype/trunk/src/z3c/filetype/README.txt	2006-09-07 21:51:09 UTC (rev 70037)
@@ -82,7 +82,7 @@
 You can also provide a path instead of a stream.
 
   >>> f.name
-  '/.../z3c/filetype/testdata/test.tar'
+  '...test.tar'
   >>> sorted(api.getInterfacesFor(f.name))
   [<InterfaceClass z3c.filetype.interfaces.filetypes.ITARFile>]
 

Modified: z3c.filetype/trunk/src/z3c/filetype/magic.py
===================================================================
--- z3c.filetype/trunk/src/z3c/filetype/magic.py	2006-09-07 21:39:12 UTC (rev 70036)
+++ z3c.filetype/trunk/src/z3c/filetype/magic.py	2006-09-07 21:51:09 UTC (rev 70037)
@@ -159,7 +159,12 @@
 #                               saved_pos = file.tell()
             if self.mtype != 'true' :
                 data = self.read(file)
-                last = file.tell()
+                try:
+                    last = file.tell()
+                except Exception, e:
+                    # TODO: check what's happen here, I run into this on 
+                    # windows guessing a content type for flv files. ri
+                    pass
             else:
                 data = last = None
             if self.check( data ) :


Property changes on: z3c.filetype/trunk/src/z3c/filetype/testdata/IMG_0504.JPG
___________________________________________________________________
Name: svn:mime-type
   - application/octet-stream
   + image/jpeg


Property changes on: z3c.filetype/trunk/src/z3c/filetype/testdata/test.flv
___________________________________________________________________
Name: svn:mime-type
   - application/octet-stream
   + video/x-flv



More information about the Checkins mailing list