Skip to content

Prevent mode='r+' from creating new directories #3307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dstansby
Copy link
Contributor

@dstansby dstansby commented Jul 29, 2025

Fixes #3295. I'm not sure if I came up with the most elegant solution, but I couldn't think of a way to solve this without passing the mode to LocalStore.open(). Other suggestions very welcome if anyone has any better ideas?

@github-actions github-actions bot added the needs release notes Automatically applied to PRs which haven't added release notes label Jul 29, 2025
@dstansby dstansby force-pushed the r+ branch 2 times, most recently from d84eada to ee21ccf Compare July 30, 2025 12:13
@dstansby dstansby added this to the 3.1.2 milestone Jul 30, 2025
@dstansby dstansby force-pushed the r+ branch 2 times, most recently from 8ddf8d4 to 9342439 Compare August 4, 2025 11:04
@dstansby dstansby marked this pull request as ready for review August 4, 2025 12:29
Copy link

codecov bot commented Aug 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.55%. Comparing base (a26926c) to head (823e87a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3307   +/-   ##
=======================================
  Coverage   94.54%   94.55%           
=======================================
  Files          78       78           
  Lines        9423     9435   +12     
=======================================
+ Hits         8909     8921   +12     
  Misses        514      514           
Files with missing lines Coverage Δ
src/zarr/storage/_common.py 92.43% <100.00%> (ø)
src/zarr/storage/_local.py 92.21% <100.00%> (+0.60%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs release notes Automatically applied to PRs which haven't added release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using r+ mode with zarr.open creates an empty directory
1 participant