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 upGitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up
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?