[Zope-dev] bad bare except in PageTemplateFile.py

Shane Hathaway shane@zope.com
Thu, 18 Jul 2002 10:14:03 -0400


Steve Alexander wrote:
> Shane Hathaway wrote:
> 
>>
>> os.stat() raises OSError if the file is not found, in which case mtime 
>> should be set to 0.
> 
> 
> Surely if the file is not found, that's an error because the 
> PageTemplateFile is pointing at a source file that doesn't exist.
> 
> I cannot think of any reason I'd want not to be informed that the source 
> file for a PageTemplateFile isn't there. That's clearly a programming 
> error.
> 
> So, I suggest removing the try: except: clause entirely, and letting 
> os.stat() raise its error.
> 
> Or, am I missing something here?

I vaguely recall having a similar discussion with someone regarding 
DTMLFile, and we decided it had to ignore missing files, but I don't 
remember why.  Also, the open() call just below that line will raise an 
equivalent exception.  Use your judgment--mine is clouded. :-)

Shane