def METHOD_NAME(handle_umask, tmp_path):
    os.umask(0o022)
    f1 = str(tmp_path / "1")
    with atomic_writing(f1) as f:
        f.write("1")
    mode = stat.S_IMODE(os.stat(f1).st_mode)
    assert mode == 0o644
    os.umask(0o057)
    f2 = str(tmp_path / "2")
    with atomic_writing(f2) as f:
        f.write("2")
    mode = stat.S_IMODE(os.stat(f2).st_mode)
    assert mode == 0o620