This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rubenlm
Recipients r.david.murray, rubenlm, tarek
Date 2010-04-29.14:08:08
SpamBayes Score 0.00299796
Marked as misclassified No
Message-id <>
Here is my current error handler:

def handleRmtreeError(func, path, exc):
  excvalue = exc[1]
  if excvalue.errno == errno.EACCES:
    if func in (os.rmdir, os.remove):
      parentpath = path.rpartition('/')[0]
      os.chmod(parentpath, stat.S_IRWXU) # 0700
    elif func is os.listdir:
      os.chmod(path, stat.S_IRWXU) # 0700
      rmtree(path=path, ignore_errors=False, onerror=handleRmtreeError)

Looking back to this code there is an infinite recursion bug if os.chmod fails for some reason in the os.listdir condition. I don't see an easy way to solve this...
Date User Action Args
2010-04-29 14:08:11rubenlmsetrecipients: + rubenlm, tarek, r.david.murray
2010-04-29 14:08:11rubenlmsetmessageid: <>
2010-04-29 14:08:08rubenlmlinkissue8523 messages
2010-04-29 14:08:08rubenlmcreate