Skip to content

os.chmod failure #45272

Closed
Closed

Description

@rgheck
mannequin
BPO 1767242
Nosy @birkenfeld

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2007-09-07.07:40:37.277>
created_at = <Date 2007-08-03.18:02:26.000>
labels = []
title = 'os.chmod failure'
updated_at = <Date 2007-09-07.07:40:37.276>
user = 'https://bugs.python.org/rgheck'

bugs.python.org fields:

activity = <Date 2007-09-07.07:40:37.276>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = <Date 2007-09-07.07:40:37.277>
closer = 'georg.brandl'
components = ['None']
creation = <Date 2007-08-03.18:02:26.000>
creator = 'rgheck'
dependencies = []
files = []
hgrepos = []
issue_num = 1767242
keywords = []
message_count = 4.0
messages = ['32580', '32581', '32582', '32583']
nosy_count = 3.0
nosy_names = ['nnorwitz', 'georg.brandl', 'rgheck']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1767242'
versions = []

Linked PRs

Activity

  1. rgheck commented on Aug 3, 2007

    rgheckmannequin
    MannequinAuthor
    When running on Linux and accessing a FAT partition, os.chmod fails with otherwise sensible partitions:
    >>> os.chmod("/media/IHP-100/Test.lyx", 400)
    >>> os.chmod("/media/IHP-100/Test.lyx", 600)
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
    OSError: [Errno 1] Operation not permitted: '/media/IHP-100/Test.lyx'
    The only thing that seems to be allowed is `4'.
  2. birkenfeld commented on Aug 3, 2007

    @birkenfeld
    Member

    Why do you think this is Python's fault? os.chmod() is only a very thin wrapper around the OS' chmod().

  3. rgheck commented on Aug 3, 2007

    rgheckmannequin
    MannequinAuthor

    Well, the shell's chmod doesn't return an error.

    [rgheck@rghstudy scripts]$ chmod 600 /media/IHP-100/Test.lyx
    [rgheck@rghstudy scripts]$ echo $?
    0
    [rgheck@rghstudy scripts]$ chmod 400 /media/IHP-100/Test.lyx
    [rgheck@rghstudy scripts]$ echo $?
    0
    [rgheck@rghstudy scripts]$ chmod 700 /media/IHP-100/Test.lyx
    [rgheck@rghstudy scripts]$ echo $?
    0
    [rgheck@rghstudy scripts]$ python
    Python 2.4.4 (#1, Oct 23 2006, 13:58:00)
    [GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import os
    >>> os.chmod("/media/IHP-100/Test.lyx", 400)
    >>> os.chmod("/media/IHP-100/Test.lyx", 600)
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
    OSError: [Errno 1] Operation not permitted: '/media/IHP-100/Test.lyx'

    I don't know what would happen in C, say.

  4. nnorwitz commented on Aug 7, 2007

    nnorwitzmannequin
    Mannequin

    Note: you are *not* using octal in python, but the chmod program is using octal:

    Try prefixing 400/600 with a zero, ie: 0400 or 0600.

  5. transferred this issue fromon Apr 10, 2022
  6. added 2 commits that reference this issue on Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions