X Tutup
The Wayback Machine - https://web.archive.org/web/20201208100917/https://github.com/certbot/certbot/issues/7992
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

Create umask context manager #7992

Open
bmw opened this issue May 14, 2020 · 0 comments
Open

Create umask context manager #7992

bmw opened this issue May 14, 2020 · 0 comments

Comments

@bmw
Copy link
Member

@bmw bmw commented May 14, 2020

In all of our current uses of os.umask or filesystem.umask, we always temporarily set it to a different value and then restore it using a try/finally block. I expect this pattern to continue.

Because of that, why don't we create a simple function in certbot.util that can be used as a context manager to set umask to a value and restore it to its previous value when exiting the with block?

Mercerenies added a commit to Mercerenies/certbot that referenced this issue May 26, 2020
Mercerenies added a commit to Mercerenies/certbot that referenced this issue May 26, 2020
@Mercerenies Mercerenies mentioned this issue May 26, 2020
0 of 2 tasks complete
Mercerenies added a commit to Mercerenies/certbot that referenced this issue May 27, 2020
Mercerenies added a commit to Mercerenies/certbot that referenced this issue May 27, 2020
Mercerenies added a commit to Mercerenies/certbot that referenced this issue May 27, 2020
@commit-dkp commit-dkp mentioned this issue Aug 24, 2020
2 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant
You can’t perform that action at this time.
X Tutup