Skip to content

Route MultiFS removal through the writable filesystem - #607

Open
Hugohong258 wants to merge 1 commit into
PyFilesystem:masterfrom
Hugohong258:fix-multifs-readonly-removal
Open

Hugohong258 wants to merge 1 commit into
PyFilesystem:masterfrom
Hugohong258:fix-multifs-readonly-removal

Conversation

@Hugohong258

Copy link
Copy Markdown

Type of changes

  • Bug fix
  • Tests

Checklist

  • Black 22.3.0, pinned by the repository's codeformat environment, passes with default settings on changed Python files.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @PyFilesystem/maintainers may be pedantic in the code review.

Description

remove() and removedir() currently use the read lookup, so they can delete resources from a child added with write=False, including when no write filesystem is configured. Route both through _writable_required(), consistently with other modifying operations. A higher-priority read source is preserved; deletion acts on the configured writer, and a missing writer-side resource raises ResourceNotFound. Fixes #572.

All six new regressions fail on the base. On Windows/Python 3.9.25, the complete MultiFS module passes 101 tests with 1 skip. Project-pinned Black 22.3, Flake8 3.7.9 with the configured plugins, and mypy 0.800 on the changed source pass. The full 57-file type check reports the same five diagnostics on unchanged upstream and both patched worktrees (four Windows-only os members and one entry-point type). Existing pkg_resources deprecation warnings remain. The full project/platform matrix was not run.

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.

MultiFS allows removing files from Filesystem added with write=False

1 participant