def METHOD_NAME(path, mode):
    if mode == "r":
        access = os.O_RDONLY
    else:
        assert mode == "w"
        access = os.O_WRONLY
    fd = os.open(path, access)  # We do not want O_TRUNC / O_CREAT!
    return os.fdopen(fd, mode + "b", buffering=0)