Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCreate umask context manager #7992
Open
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In all of our current uses of
os.umaskorfilesystem.umask, we always temporarily set it to a different value and then restore it using atry/finallyblock. I expect this pattern to continue.Because of that, why don't we create a simple function in
certbot.utilthat can be used as a context manager to set umask to a value and restore it to its previous value when exiting thewithblock?