Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancing os.chown functionality #41977

Closed
gyrof mannequin opened this issue May 12, 2005 · 4 comments
Closed

enhancing os.chown functionality #41977

gyrof mannequin opened this issue May 12, 2005 · 4 comments
Labels
extension-modules C modules in the Modules dir type-feature A feature request or enhancement

Comments

@gyrof
Copy link
Mannequin

gyrof mannequin commented May 12, 2005

BPO 1200804
Nosy @loewis, @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 2005-06-01.20:37:43.000>
created_at = <Date 2005-05-12.16:26:34.000>
labels = ['extension-modules', 'type-feature']
title = 'enhancing os.chown functionality'
updated_at = <Date 2005-06-01.20:37:43.000>
user = 'https://bugs.python.org/gyrof'

bugs.python.org fields:

activity = <Date 2005-06-01.20:37:43.000>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Extension Modules']
creation = <Date 2005-05-12.16:26:34.000>
creator = 'gyrof'
dependencies = []
files = []
hgrepos = []
issue_num = 1200804
keywords = []
message_count = 4.0
messages = ['54521', '54522', '54523', '54524']
nosy_count = 4.0
nosy_names = ['loewis', 'jepler', 'georg.brandl', 'gyrof']
pr_nums = []
priority = 'normal'
resolution = 'rejected'
stage = None
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue1200804'
versions = []

@gyrof
Copy link
Mannequin Author

gyrof mannequin commented May 12, 2005

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

@gyrof gyrof mannequin closed this as completed May 12, 2005
@gyrof gyrof mannequin added extension-modules C modules in the Modules dir type-feature A feature request or enhancement labels May 12, 2005
@gyrof gyrof mannequin closed this as completed May 12, 2005
@gyrof gyrof mannequin added extension-modules C modules in the Modules dir type-feature A feature request or enhancement labels May 12, 2005
@jepler
Copy link
Mannequin

jepler mannequin commented May 18, 2005

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.

@loewis
Copy link
Mannequin

loewis mannequin commented May 20, 2005

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.

@birkenfeld
Copy link
Member

Logged In: YES
user_id=1188172

I've create patch bpo-1213031 which includes a note in the docs
about this.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant