Skip to content
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

PR: Handle merging directories containing same-named read-only files #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docrepr/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ def merge_directories(source, destination):
"""Merge a source into a dest dir; compat shim for Python <3.8."""
try:
shutil.copytree(source, destination, dirs_exist_ok=True)
except TypeError:
except (TypeError, shutil.Error):
# XXX: Also handle shutil.Error, which can occur when
# shutil.copytree attempts to merge directories containing
# same-named read-only files. This case is correctly handled
# by the manual copy routine below.
pass
else:
return
Expand Down