execfile locks file forever if there are any syntax errors - is it python bug?

Slawomir Nowaczyk slawomir.nowaczyk.847 at student.lu.se
Wed Mar 14 08:07:57 EDT 2007


Hello,

When I execfile a file which contains a syntax error, the file becomes
locked and stays this way all the way until I exit the interpreter (I am
unable to delete it, for example). I have tried but failed to find any
way to unlock the file... Is this a bug in Python?

Is there *any* way to unlock the file? It is annoying for me because I
often execfile various temporary files and it is a nuisance not to be
able to delete them.

I have tested with Python 2.5 on Windows... do other versions of Python
behave this way as well?

-- 
 Best wishes,
   Slawomir Nowaczyk
     ( Slawomir.Nowaczyk at cs.lth.se )

I didn't fight my way to the top of the food chain to be a vegetarian.




More information about the Python-list mailing list