diff Lib/distutils/command/install_scripts.py @ 21852:9e384f103047 legacy-trunk

Restrict the mode to the lowest four octal positions; higher positions contain the type of the file (regular file, socket, link, &c.). This means that install_scripts will now print "changing mode of <file> to 775" instead of "... to 100775". 2.2 bugfix candidate, I suppose, though this isn't actually fixing a bug.
author Andrew M. Kuchling <amk@amk.ca>
date Thu, 31 Jan 2002 22:08:38 +0000
parents 7acb8bbc215b
children 7d30585a5934 ca87119255eb
line wrap: on
line diff
--- a/Lib/distutils/command/install_scripts.py	Thu Jan 31 18:56:00 2002 +0000
+++ b/Lib/distutils/command/install_scripts.py	Thu Jan 31 22:08:38 2002 +0000
@@ -50,7 +50,7 @@
                 if self.dry_run:
                     self.announce("changing mode of %s" % file)
                 else:
-                    mode = (os.stat(file)[ST_MODE]) | 0111
+                    mode = ((os.stat(file)[ST_MODE]) | 0111) & 07777
                     self.announce("changing mode of %s to %o" % (file, mode))
                     os.chmod(file, mode)