]> granicus.if.org Git - python/commitdiff
#4601: 'make install' did not set the permissions on library directories,
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>
Thu, 2 Jul 2009 23:08:45 +0000 (23:08 +0000)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>
Thu, 2 Jul 2009 23:08:45 +0000 (23:08 +0000)
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...

Misc/NEWS
setup.py

index 5d4c3ee7b80b62965c3ce826f0a68203e8f5b96b..543c55f8975897d454bad6f12443d677e4967f5a 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -41,6 +41,9 @@ Library
 Build
 -----
 
+- Issue 4601: 'make install' did not set the appropriate permissions on
+  directories.
+
 - Issue 5390: Add uninstall icon independent of whether file
   extensions are installed.
 
index 2738eecc383a438f46caf43328fd5d454122bec8..c42416edf8b77648fd001c06fc096e6ddd2fd56d 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1605,12 +1605,11 @@ class PyBuildInstallLib(install_lib):
 
     def set_dir_modes(self, dirname, mode):
         if not self.is_chmod_supported(): return
-        os.walk(dirname, self.set_dir_modes_visitor, mode)
-
-    def set_dir_modes_visitor(self, mode, dirname, names):
-        if os.path.islink(dirname): return
-        log.info("changing mode of %s to %o", dirname, mode)
-        if not self.dry_run: os.chmod(dirname, mode)
+        for dirpath, dirnames, fnames in os.walk(dirname):
+            if os.path.islink(dirpath):
+                continue
+            log.info("changing mode of %s to %o", dirpath, mode)
+            if not self.dry_run: os.chmod(dirpath, mode)
 
     def is_chmod_supported(self):
         return hasattr(os, 'chmod')