When HOME was undefined on Linux, the code would try calling os.listdir(None) which will obviously fail. This is a workaround. A proper fix would be to rewrite the code to check for each operating system, not a combination of operating systems, environment variables and the current air humidity in London.