| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -230,9 +230,7 @@ Directory and files operations | |
| dirs_exist_ok=False) | ||
|
|
||
| Recursively copy an entire directory tree rooted at *src* to a directory | ||
| named *dst* and return the destination directory. *dirs_exist_ok* dictates | ||
| whether to raise an exception in case *dst* or any missing parent directory | ||
| already exists. | ||
| named *dst* and return the destination directory. | ||
|
|
||
| Permissions and times of directories are copied with :func:`copystat`, | ||
| individual files are copied using :func:`~shutil.copy2`. | ||
| Expand Down Expand Up | @@ -263,8 +261,13 @@ Directory and files operations | |
|
|
||
| If *copy_function* is given, it must be a callable that will be used to copy | ||
| each file. It will be called with the source path and the destination path | ||
| as arguments. By default, :func:`~shutil.copy2` is used, but any function | ||
| that supports the same signature (like :func:`~shutil.copy`) can be used. | ||
| as arguments. By default, :func:`~shutil.copy2` is used, but any function | ||
| that supports the same signature (like :func:`~shutil.copy`) can be used. | ||
|
|
||
| If *dirs_exist_ok* is false (the default), a :exc:`FileExistsError` is | ||
| raised if *dst* already exists. Conversely, *dst* as well as any any parent | ||
|
Comment thread
Outdated
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityI think this phrasing is a bit unclear. 'conversely' implies that the following is opposite to how the default value works. In other words, I would read this sentence as saying that with dirs_exist_ok=False, dirs along the path to dst, as well as dst itself, will not be created.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityYeah, you are totally correct; I've made it more confusing. I changed it to be much more explicit.
Sorry, something went wrong.
All reactions
|
||
| directory in the path to *dst* will be created if they do not exist when | ||
| the *dirs_exist_ok* flag is true. | ||
|
|
||
| .. audit-event:: shutil.copytree src,dst shutil.copytree | ||
|
|
||
| Expand Down | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Clarify the meaning of *dirs_exist_ok*, a kwarg passed to the shutil.copytree | ||
|
Comment thread
Outdated
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityLet's make it a link -- :func:shutil.copytree
Sorry, something went wrong.
All reactions
|
||
| function. | ||
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.