We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
shutil.copyfile()
follow_symlinks=False
I think it's a regression from #142693.
copyfile() rejects a symlink to a device even when follow_symlinks=False.
copyfile()
import os import shutil import tempfile with tempfile.TemporaryDirectory() as directory: src = os.path.join(directory, "src") dst = os.path.join(directory, "dst") os.symlink("/dev/null", src) shutil.copyfile(src, dst, follow_symlinks=False)
shutil.SpecialFileError:
is a character device
dst
/dev/null
The docs say:
If follow_symlinks is false and src is a symbolic link, a new symbolic link will be created instead of copying the file src points to.
follow_symlinks
src
CPython main branch
macOS
Bug report
Bug description:
I think it's a regression from #142693.
copyfile()rejects a symlink to a device even whenfollow_symlinks=False.shutil.SpecialFileError:.../srcis a character devicedstis created as a symlink to/dev/nullThe docs say:
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
shutil.copyfile()for device symlinks withfollow_symlinks=False#154728