[Python-ideas] Add shutil.chown(..., recursive=False)
wes.turner at gmail.com
Wed May 30 12:19:34 EDT 2018
On Wednesday, May 30, 2018, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On 30 May 2018 at 02:38, Guido van Rossum <guido at python.org> wrote:
>> Honestly, despite the occasional use case(1), I'm not sure that this is a
>> battery we need in the stdlib. Nobody seems too excited about writing the
>> code, and when the operation is needed, shelling out to the system chown is
>> not too onerous. (Ditto for chmod.)
>> (1) Not even sure that a use case was shown -- it was just shown that the
>> operation is not necessarily useless.
> My main use cases have been in installers and test suites, but those cases
> have also been for Linux-specific code where shelling out to "chown -R" and
> "chmod -R" was an entirely acceptable alternative.
> I think one of the other key points here is that "chown" and "chmod"
> inherently don't map at all well to the Windows filesystem access control
> model , so there's no new portability challenges arising from expecting
> the chown and chmod commands to be available.
>  os.chown and shutil.chown don't exist at all there, and os.chmod only
> supports setting a file to read-only - there isn't any access to user or
> group permissions.
Notably, Ansible and Salt don't haven't even tried to abstract Linux/BSD
and Windows filesystem ACLs into a common API:
... Looked these up and thought I'd share.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas