title: Detect and delete locked file in python
body: <p>I want to detect whether a file is locked, using python on Unix. It's OK to delete the file, assuming that it helps detects whether the file was locked.</p>
  
  <p>The file could have been originally opened exclusively by another process. Documentation seems to suggest that os.unlink won't necessarily return an error if the file is locked. </p>
  
  <p>Ideas?  </p>