def try_getsize(f):
        """in case the file is removed with git rm"""
        try:
            return os.path.getsize(f)
        except (EnvironmentError, OSError):
            return 0
in case the file is removed with git rm
recipes/Python/578883_git_precommit_hook_reject_large_files_using/recipe-578883.py