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 where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.


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?