#4601: 'make install' did not set the permissions on library directories,

only root could start IDLE for example.

Beware that os.path.walk does not translate as is to os.walk!
the former uses a callback to call on each dir, the latter is a generator...
This commit is contained in:
Amaury Forgeot d'Arc 2009-07-02 23:08:45 +00:00
parent bceae0c1af
commit 321e533c4c
2 changed files with 8 additions and 6 deletions

View File

@ -41,6 +41,9 @@ Library
Build Build
----- -----
- Issue 4601: 'make install' did not set the appropriate permissions on
directories.
- Issue 5390: Add uninstall icon independent of whether file - Issue 5390: Add uninstall icon independent of whether file
extensions are installed. extensions are installed.

View File

@ -1605,12 +1605,11 @@ class PyBuildInstallLib(install_lib):
def set_dir_modes(self, dirname, mode): def set_dir_modes(self, dirname, mode):
if not self.is_chmod_supported(): return if not self.is_chmod_supported(): return
os.walk(dirname, self.set_dir_modes_visitor, mode) for dirpath, dirnames, fnames in os.walk(dirname):
if os.path.islink(dirpath):
def set_dir_modes_visitor(self, mode, dirname, names): continue
if os.path.islink(dirname): return log.info("changing mode of %s to %o", dirpath, mode)
log.info("changing mode of %s to %o", dirname, mode) if not self.dry_run: os.chmod(dirpath, mode)
if not self.dry_run: os.chmod(dirname, mode)
def is_chmod_supported(self): def is_chmod_supported(self):
return hasattr(os, 'chmod') return hasattr(os, 'chmod')