Message410155
Pathlib.rename will fail across file system with:
OSError: [Errno 18] Invalid cross-device link
e.g:
-> path_dict["current_path"].rename(path_dict["destination"])
(Pdb) n
OSError: [Errno 18] Invalid cross-device link: '/tmp/pipenv-k1m0oynt-yaml/PyYAML-6.0/lib/yaml' -> '/home/oz123/Software/pipenv/pipenv/patched/yaml3'
This is because it uses os.rename under the hood:
https://github.com/python/cpython/blob/3.10/Lib/pathlib.py#L306
One can either replace it with `shutil.move` which works, or one could
add another method to Pathlib.move(...) with similar signature and return value, which calls `shutil.move` under the hood.
Before submitting a patch for that, I would like to get feedback for that. |
|
Date |
User |
Action |
Args |
2022-01-09 14:52:56 | Oz.Tiram | set | recipients:
+ Oz.Tiram |
2022-01-09 14:52:56 | Oz.Tiram | set | messageid: <1641739976.38.0.625892156687.issue46317@roundup.psfhosted.org> |
2022-01-09 14:52:56 | Oz.Tiram | link | issue46317 messages |
2022-01-09 14:52:56 | Oz.Tiram | create | |
|