New submission from Christopher Hunt <[email protected]>:
Currently shutil.copyfile raises SpecialFileError when src is a link to a fifo.
To reproduce:
import os
import shutil
import tempfile
d = tempfile.mkdtemp()
fifo = os.path.join(d, 'fifo')
link_to_fifo = os.path.join(d, 'link-to-fifo')
copy_of_link_to_fifo = os.path.join(d, 'copy-of-link-to-fifo')
os.mkfifo(fifo)
os.symlink(fifo, link_to_fifo)
shutil.copyfile(link_to_fifo, copy_of_link_to_fifo)
Example output:
Traceback (most recent call last):
File "repro.py", line 14, in <module>
shutil.copyfile(link_to_fifo, copy_of_link_to_fifo)
File "/home/chris/.pyenv/versions/3.7.2/lib/python3.7/shutil.py", line
115, in copyfile
raise SpecialFileError("`%s` is a named pipe" % fn)
shutil.SpecialFileError: `/tmp/user/1000/tmpxhigll5g/link-to-fifo` is a
named pipe
I would have expected this to copy the symlink without complaint. Raising a
SpecialFileError would be OK if `follow_symlinks` was False.
----------
components: Library (Lib)
messages: 348597
nosy: chrahunt
priority: normal
severity: normal
status: open
title: shutil.copyfile raises SpecialFileError for symlink to fifo
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37701>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com