From: Michael W. Hudson Date: Fri, 22 Feb 2002 13:19:54 +0000 (+0000) Subject: backport akuchling's checkin of X-Git-Tag: v2.2.1c1~198 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=94e500036772f207ed99a9c1eb9fda1c719f7e00;p=thirdparty%2FPython%2Fcpython.git backport akuchling's checkin of revision 1.11 of install_scripts.py 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. This patch was applied by an alarmingly automated system -- I hope it worked... --- diff --git a/Lib/distutils/command/install_scripts.py b/Lib/distutils/command/install_scripts.py index 3bc23e7460f1..d4cbaa3a0a8b 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)