Skip to content

COPY of #2486#2512

Draft
shaahji wants to merge 1 commit into
mainfrom
fix/copy-dir-ignore-errors-kwarg-leak
Draft

COPY of #2486#2512
shaahji wants to merge 1 commit into
mainfrom
fix/copy-dir-ignore-errors-kwarg-leak

Conversation

@shaahji

@shaahji shaahji commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

shutil.copytree does not accept ignore_errors, so any caller passing copy_dir(..., ignore_errors=True) would raise TypeError at runtime. The kwarg was silently swallowed by mocks before mockey autospec enforcement surfaced the mismatch.

Promote ignore_errors to an explicit parameter on copy_dir and use it to control RuntimeError suppression in the shutil.Error handler.

Also adds mockey to test requirements and initializes patch_mock_module() in test/init.py to enforce mock call signatures across the test suite.

Describe your changes

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.

(Optional) Issue link

shutil.copytree does not accept ignore_errors, so any caller passing
copy_dir(..., ignore_errors=True) would raise TypeError at runtime.
The kwarg was silently swallowed by mocks before mockey autospec
enforcement surfaced the mismatch.

Promote ignore_errors to an explicit parameter on copy_dir and use it
to control RuntimeError suppression in the shutil.Error handler.

Also adds mockey to test requirements and initializes patch_mock_module()
in test/__init__.py to enforce mock call signatures across the test suite.
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.

2 participants