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.
This commit is contained in:
Andrew M. Kuchling 2002-01-31 22:08:38 +00:00
parent 2544f51036
commit b24231e088
1 changed files with 1 additions and 1 deletions

View File

@ -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)