Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0.3, 2.0.4, and 2.0.5

stable qtlib: fix clean-up of temporary directory on unix

Since os.path.walk() calls writeable() with (parentdirname, file+dirnames),
os.chmod(dirname, stat.S_IWUSR) drops executable bit of directories.
Thus, cleanup() fails to iterate sub-directories.

Changeset 309de148cd73

Parent 55cc60eb62eb

by Yuya Nishihara

Changes to one file · Browse files at 309de148cd73 Showing diff from parent 55cc60eb62eb Diff from another changeset...

 
32
33
34
35
36
37
 
 
 
 
38
39
40
 
32
33
34
 
 
 
35
36
37
38
39
40
41
@@ -32,9 +32,10 @@
 def gettempdir():   global tmproot   def cleanup(): - def writeable(arg, dirname, fnames): - for fname in fnames: - os.chmod(os.path.join(dirname, fname), stat.S_IWUSR) + def writeable(arg, dirname, names): + for name in names: + fullname = os.path.join(dirname, name) + os.chmod(fullname, os.stat(fullname).st_mode | stat.S_IWUSR)   try:   os.path.walk(tmproot, writeable, None)   shutil.rmtree(tmproot)