[Python-bugs-list] [ python-Bugs-449383 ] os.chmod sets mode incorrectly

noreply@sourceforge.net noreply@sourceforge.net
Wed, 08 Aug 2001 21:17:49 -0700


Bugs item #449383, was opened at 2001-08-08 21:02
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=449383&group_id=5470

Category: None
>Group: Not a Bug
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: UoC COSC Programmers (uoccosc)
Assigned to: Nobody/Anonymous (nobody)
Summary: os.chmod sets mode incorrectly

Initial Comment:
I'm using
ActivePython 2.1, build 211 (ActiveState)
based on Python 2.1 (#1, Jun 13 2001, 01:01:26) 
[GCC 2.95.2 19991024 (release)] on sunos5

on
SunOS %host% 5.7 Generic sun4u sparc SUNW,Ultra-1

os.chmod does not set the correct mode, for example

os.chmod(path, 700)
result   --w-rwxr--
expected -rwx------

os.chmod(path, 644)
result   --w----r--
expected -rw-r--r--

----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2001-08-08 21:17

Message:
Logged In: YES 
user_id=31435

This looks like pilot error to me:  chmod interprets its 
second argument as a bitmask, and you're passing it decimal 
integers.

>>> oct(700)
'01274'
>>> oct(644)
'01204'
>>>

That explains what you're seeing, so I'm closing this bug.  
Pass 0700 and 0644 instead.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=449383&group_id=5470