{"record":{"id":"0fbb9f463fd72aeb","repo":"pypa/pip","slug":"error-reading-path-e","errorCode":null,"errorMessage":"Error reading {path}: {e}","messagePattern":"Error reading (.+?): (.+?)","errorType":"validation","errorClass":"InstallationError","httpStatus":null,"severity":"error","filePath":"src/pip/_internal/req/req_dependency_group.py","lineNumber":86,"sourceCode":"\n    return resolvers\n\n\ndef _load_pyproject(path: str) -> dict[str, Any]:\n    \"\"\"\n    This helper loads a pyproject.toml as TOML.\n\n    It raises an InstallationError if the operation fails.\n    \"\"\"\n    try:\n        with open(path, \"rb\") as fp:\n            return tomllib.load(fp)\n    except FileNotFoundError:\n        raise InstallationError(f\"{path} not found. Cannot resolve '--group' option.\")\n    except tomllib.TOMLDecodeError as e:\n        raise InstallationError(f\"Error parsing {path}: {e}\") from e\n    except OSError as e:\n        raise InstallationError(f\"Error reading {path}: {e}\") from e\n","sourceCodeStart":68,"sourceCodeEnd":87,"githubUrl":"https://github.com/pypa/pip/blob/f399c3718970b1b0e2478dac5296eb62679a9b86/src/pip/_internal/req/req_dependency_group.py#L68-L87","documentation":"An OS-level error other than FileNotFoundError or TOMLDecodeError occurred while reading pyproject.toml for dependency-group resolution. This is typically a permission denied, or a disk/IO error. The generic OSError is caught and wrapped.","triggerScenarios":"pyproject.toml exists but cannot be opened due to restrictive file permissions, or the filesystem is experiencing I/O errors. A race condition where the file is deleted between the existence check and the open call.","commonSituations":"File owned by root or another user with no read permission. Docker volume mount issues. Network filesystem (NFS) hiccups. File locked by another process on Windows.","solutions":["Check file permissions: 'ls -l pyproject.toml' and ensure you have read access","Fix ownership or permissions: 'chmod +r pyproject.toml' or 'chown $USER pyproject.toml'","If on a network filesystem, verify connectivity and retry","On Windows, check the file is not locked by another process"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import os\n\ndef is_readable(path: str) -> bool:\n    return os.path.isfile(path) and os.access(path, os.R_OK)\n\nif not is_readable(\"pyproject.toml\"):\n    print(\"pyproject.toml is not readable — check permissions\")","typeGuard":"import os\n\ndef is_readable_file(path: str) -> bool:\n    \"\"\"Type guard: True if path is a readable file.\"\"\"\n    return os.path.isfile(path) and os.access(path, os.R_OK)","tryCatchPattern":"from pip._internal.exceptions import InstallationError\nfrom pip._internal.req.req_dependency_group import parse_dependency_groups\n\ntry:\n    reqs = parse_dependency_groups([(\"pyproject.toml\", \"dev\")])\nexcept InstallationError as e:\n    if \"Error reading\" in str(e):\n        print(\"Check file permissions: chmod +r pyproject.toml\")\n    else:\n        raise","preventionTips":["Check file permissions with 'ls -l pyproject.toml' before running pip","Ensure the CI user has read access to pyproject.toml","On network filesystems, verify connectivity if intermittent I/O errors occur"],"tags":["pip","dependency-groups","permissions","io-error","pyproject"],"backgroundTag":null,"analyzedSha":"f399c3718970b1b0e2478dac5296eb62679a9b86","analyzedAt":"2026-08-08T23:01:42.227Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}