Skip to content

Fix Windows Zarr directory detection in open_dataset - #11802

Open
galafis wants to merge 3 commits into
pydata:mainfrom
galafis:fix-windows-zarr-engine-detection
Open

galafis wants to merge 3 commits into
pydata:mainfrom
galafis:fix-windows-zarr-engine-detection

Conversation

@galafis

@galafis galafis commented Oct 24, 2026

Copy link
Copy Markdown

Description

Closes #11799. Windows raises PermissionError when the magic-number probe opens a directory, stopping engine detection before the Zarr backend can inspect the store.

Handle that exception only when os.path.isdir(path) is true. Permission errors for regular files still propagate. Tests cover the real Windows error, a simulated directory/file permission error, and automatic dataset opening with Zarr formats 2 and 3 using both strings and Path objects.

Validation on Windows / Python 3.12.14: 6 focused failures before the fix; after the fix, the complete utils and backend-plugin modules pass (101 passed, 1 skipped: h5netcdf unavailable). An additional selected Zarr run passed 12 tests. Ruff 0.16.10 lint, format and docstring-preview checks passed, as did git diff --check. Tests ran in an isolated uv environment; Pixi was unavailable.

Checklist

AI Disclosure

  • This PR contains AI-generated content.
  • I have tested any AI-generated content in my PR.
  • I take responsibility for any AI-generated content in my PR.

Tools: Codex. Gabriel reviewed and confirmed understanding of the published diff before authorizing submission.

Prompt: “Continue contribuindo em outros projetos grandes e médios das nossas áreas, com correções relevantes e bem testadas. Quero ampliar nossa participação; só mencione IA quando o projeto exigir explicitamente.”

[This is Codex on behalf of Gabriel Demetrios Lafis.]

galafis and others added 3 commits October 24, 2026 12:49
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

open_dataset raises PermissionError during engine detection for a local Zarr directory on Windows

1 participant