Re: [PATCH 2/2] Don't try to delete a directory tree from within that tree
2012-06-30 09:32:46 GMT
Cleanup of some temp directory triggers it. Search for chdir followed by this call in the next 80 lines. If you mean to fix the caller without applying this patch, that'd be a mistake IMO. This is a kind of portability bug that you'll keep making otherwise, because it's so easy to do and is silent on Linux. Sent from my Q-42 Space Modulator On Jun 30, 2012, at 4:48 AM, Thomas Leonard <talex5 <at> gmail.com> wrote: > On 29 June 2012 18:51, Dave Abrahams <dave <at> boostpro.com> wrote: >> --- >> zeroinstall/support/__init__.py | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/zeroinstall/support/__init__.py b/zeroinstall/support/__init__.py >> index efe3b8a..c652362 100644 >> --- a/zeroinstall/support/__init__.py >> +++ b/zeroinstall/support/__init__.py >> <at> <at> -76,6 +76,10 <at> <at> def ro_rmtree(root): >> import shutil >> import platform >> if platform.system() == 'Windows': >> + def true_path(x): >> + return os.path.normcase(os.path.normpath(os.path.realpath(x))); >> + if true_path(os.getcwd()).startswith(true_path(root)): >> + os.chdir(os.path.join(root,os.path.pardir)) >> for main, dirs, files in os.walk(root): >> for i in files + dirs: >> os.chmod(os.path.join(main, i), 0o700) > > What triggers this? Probably we should fix the caller.(Continue reading)
RSS Feed