From: Andrew M. Kuchling Date: Thu, 31 Jan 2002 22:08:38 +0000 (+0000) Subject: Restrict the mode to the lowest four octal positions; higher positions X-Git-Tag: v2.3c1~6755 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b24231e088ad8c0b99ded3294dc0b1f4c671d38b;p=python 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 to 775" instead of "... to 100775". 2.2 bugfix candidate, I suppose, though this isn't actually fixing a bug. --- diff --git a/Lib/distutils/command/install_scripts.py b/Lib/distutils/command/install_scripts.py index 3bc23e7460..d4cbaa3a0a 100644 --- a/Lib/distutils/command/install_scripts.py +++ b/Lib/distutils/command/install_scripts.py @@ -50,7 +50,7 @@ class install_scripts (Command): 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)