[Python-ideas] Add shutil.chown(..., recursive=False)

Nick Coghlan ncoghlan at gmail.com
Wed May 30 08:59:12 EDT 2018

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 [1], so there's no new portability challenges arising from expecting
the chown and chmod commands to be available.


[1] 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.

Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180530/3b8b9aad/attachment.html>

More information about the Python-ideas mailing list