Skip to content

Add umask context manager to shutil #128432

@jb2170

Description

@jb2170

Feature or enhancement

Proposal:

PR Incoming. As discussed earlier.

We add a context manager which sets the process's umask to a specified value on entry, and resets to the old one on exit. It is reentrant safe.

We have discussed and chosen shutil as the module to add this to, not contextlib.

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

https://discuss.python.org/t/add-umask-to-contextlib/75809/21

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    pendingThe issue will be closed if no feedback is providedstdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions