This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: enhancing os.chown functionality
Type: enhancement Stage:
Components: Extension Modules Versions:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, gyrof, jepler, loewis
Priority: normal Keywords:

Created on 2005-05-12 16:26 by gyrof, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg54521 - (view) Author: gyrof (gyrof) Date: 2005-05-12 16:26
Hi,
I don't think it is currently possible (with os.chown
or any other Python library function) to change the
groupId of a file without specifying the userId (like
posix 'chgrp' does), or to change the userId without
specifying the groupId.
I would suggest adding the option of having os.chown
accept None as either the userId or groupId, and having
the function change only the 'non-None' portion of the
file ownership.

Thanks for your consideration.

-g
msg54522 - (view) Author: Jeff Epler (jepler) Date: 2005-05-18 22:49
Logged In: YES 
user_id=2772

the posix (os) module is intended as a thin wrapper around
operating system services.  The chown(2) syscall requires
that owner and group both be specified.

Possibly an enhanced chownonly/chgrp would find a home in
the 'shutil' module.

Possibly translating a parameter of None into -1 (which
means 'no change') would be accepted as a patch.
msg54523 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2005-05-20 21:41
Logged In: YES 
user_id=21627

Jeff already provided the right analysis: It *is* currently
possibly with os.chown to only change the groupid without
specifying the userid: just pass -1 as the userid. The
requested feature is already there, so I'm rejecting this
request.
msg54524 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-06-01 20:37
Logged In: YES 
user_id=1188172

I've create patch #1213031 which includes a note in the docs
about this.
History
Date User Action Args
2022-04-11 14:56:11adminsetgithub: 41977
2005-05-12 16:26:34gyrofcreate