[New-bugs-announce] [issue46317] Pathlib.rename isn't robust
report at bugs.python.org
Sun Jan 9 09:52:56 EST 2022
New submission from Oz Tiram <nahumoz at gmail.com>:
Pathlib.rename will fail across file system with:
OSError: [Errno 18] Invalid cross-device link
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:
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.
components: Library (Lib)
title: Pathlib.rename isn't robust
versions: Python 3.10, Python 3.11, Python 3.9
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce