shutil.copyfile blocks indefinitely on named pipes #47252
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee = None closed_at = <Date 2009-05-01.21:10:30.657> created_at = <Date 2008-05-29.15:32:28.978> labels = ['type-bug', 'library'] title = 'shutil.copyfile blocks indefinitely on named pipes' updated_at = <Date 2009-05-01.21:10:30.656> user = 'https://bugs.python.org/aioryi'
activity = <Date 2009-05-01.21:10:30.656> actor = 'pitrou' assignee = 'none' closed = True closed_date = <Date 2009-05-01.21:10:30.657> closer = 'pitrou' components = ['Library (Lib)'] creation = <Date 2008-05-29.15:32:28.978> creator = 'aioryi' dependencies =  files = ['13269', '13270'] hgrepos =  issue_num = 3002 keywords = ['patch'] message_count = 10.0 messages = ['67498', '67499', '67700', '67758', '67773', '81802', '83312', '83335', '83336', '86910'] nosy_count = 5.0 nosy_names = ['pitrou', 'draghuram', 'schmir', 'aioryi', 'farialima'] pr_nums =  priority = 'critical' resolution = 'fixed' stage = None status = 'closed' superseder = None type = 'behavior' url = 'https://bugs.python.org/issue3002' versions = ['Python 2.6', 'Python 2.5', 'Python 3.0']
The text was updated successfully, but these errors were encountered:
shutil.copytree() uses shutil.copyfile() to copy files recursively.
If the file happens to be a named pipe rather than a normal file,
Rather than opening the file for reading, the correct action would
The open('fifo', 'rb') already blocks. One has to use os.fdopen with
fd=os.open('fifo', os.O_RDONLY | os.O_NONBLOCK)
and then use
to check if this is a fifo.