Issue30235
Created on 2017-05-02 17:12 by brett.cannon, last changed 2022-04-11 14:58 by admin.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 1367 | JelleZijlstra, 2017-05-02 17:14 | ||
| PR 6009 | closed | rougeth, 2018-03-06 19:57 | |
| Messages (3) | |||
|---|---|---|---|
| msg292788 - (view) | Author: Brett Cannon (brett.cannon) * ![]() |
Date: 2017-05-02 17:12 | |
If you look at the docs for shutil (https://docs.python.org/3/library/shutil.html), you will notice all over it says things like "path names given as strings". The question is whether that statement is true in the face of path-like objects? If it is true then the corresponding function in shutil should be updated to accept path-like objects. If it's false then the docs for the function should be updated. This is a meta-issue to track working on the overall module (IOW separate PRs to fix things piecemeal is fine). Looks like the following functions need checking/updating: - copyfile - copymode - copystat - copy - copy2 - copytree - rmtree - move - disk_usage - chown - make_archive [ unpack_archive is covered by https://github.com/python/cpython/pull/1367] |
|||
| msg333604 - (view) | Author: Mickaƫl Schoentgen (Tiger-222) * | Date: 2019-01-14 10:49 | |
There is another place where the use of Path objects is not yet working: when move() is given a directory as argument. A patch is in review in issue32689. |
|||
| msg336824 - (view) | Author: Giampaolo Rodola' (giampaolo.rodola) * ![]() |
Date: 2019-02-28 10:26 | |
One thing to note is the copy_function parameter: if a path-like object is given as input should the copy_function receive the same object instead of a path string? >>> copytree(path_like_src, path_like_dst, copy_function=foo) Because of issue33695 in case of copytree(..., copy_function=...) we currently force to always pass path strings if copy_function is specified: https://github.com/python/cpython/blob/ed1deb0719f0ac1b08a374e30ad26a701d4d51a2/Lib/shutil.py#L450 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:45 | admin | set | github: 74421 |
| 2019-02-28 10:26:32 | giampaolo.rodola | set | messages: + msg336824 |
| 2019-02-28 05:16:02 | THRlWiTi | set | nosy:
+ THRlWiTi |
| 2019-01-14 10:52:49 | Tiger-222 | set | versions: + Python 3.8 |
| 2019-01-14 10:49:19 | Tiger-222 | set | messages: + msg333604 |
| 2019-01-14 09:56:28 | Tiger-222 | set | nosy:
+ Tiger-222 |
| 2018-06-12 09:37:54 | giampaolo.rodola | set | nosy:
+ giampaolo.rodola |
| 2018-03-06 19:57:08 | rougeth | set | keywords:
+ patch stage: test needed -> patch review pull_requests: + pull_request5774 |
| 2017-05-02 17:14:36 | JelleZijlstra | set | pull_requests: + pull_request1501 |
| 2017-05-02 17:14:06 | brett.cannon | set | versions: + Python 3.6 |
| 2017-05-02 17:12:39 | brett.cannon | create | |
