Steve Alexander wrote:
> lib/python/Products/PageTemplateFile.py, line 110, method _cook_check
> 
>         try:    mtime=os.stat(self.filename)[8]
>         except: mtime=0
> 
> 
> I've just spent an hour or so tracking down an awkward bug in some 
> unit-tests. The true error was being hidden by this bare except.
> 
> I'd change it, and commit the change, except that I don't know what it 
> is supposed to be catching. Any hints?

os.stat() raises OSError if the file is not found, in which case mtime 
should be set to 0.  There are several ways to fix this; use your 
judgment. :-)

BTW this little idiom is found all over the place, including CMF.

Shane



_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to