[issue40376] documentation for os.getgrouplist potentially misleading

2020-04-24 Thread Jens Holzkämper

Change by Jens Holzkämper :


--
keywords: +patch
pull_requests: +19020
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19702

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40376] documentation for os.getgrouplist potentially misleading

2020-04-24 Thread Jens Holzkämper

New submission from Jens Holzkämper :

https://docs.python.org/3/library/os.html#os.getgrouplist states „Return list 
of group ids that user belongs to. If group is not in the list, it is included; 
typically, group is specified as the group ID field from the password record 
for user.“, but the function is at least on Linux a wrapper for getgrouplist 
from the C standard library, which lists only the membership in groups in the 
group-database. Users can be members of groups without it being declared in the 
group database, this is often the case with the default group of the user which 
is only declared in the passwd database.

e.g. 
/etc/passwd: woodfighter:x:1000:1000:,,,:/home/woodfighter:/bin/bash
/etc/group: woodfighter:x:1000:

os.getgrouplist("woodfighter",65534) then doesn't contain group id 1000.

The documentation tries to steer a developer in the right direction with the 
second sentence but fails to state, that the list will be possibly incomplete 
otherwise. I would add something like „, because that group ID will otherwise 
be potentially omitted.“ before the last period.

--
assignee: docs@python
components: Documentation
messages: 367187
nosy: docs@python, woodfighter
priority: normal
severity: normal
status: open
title: documentation for os.getgrouplist potentially misleading
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com