GH-81881: Raise SpecialFileError for sockets and devices in shutil.copyfile#142693
GH-81881: Raise SpecialFileError for sockets and devices in shutil.copyfile#142693savannahostrowski wants to merge 10 commits into
SpecialFileError for sockets and devices in shutil.copyfile#142693Conversation
|
This PR is stale because it has been open for 30 days with no activity. |
|
@savannahostrowski , are you interested in pursuing this. Overall this looks good to me. |
Documentation build overview
14 files changed ·
|
|
@orsenthil Yes, but was waiting for someone else to review it! |
|
Test failures in test_logging seems unrelated. It should be re-run.
For Character Device. This is a legitimate program at the moment and it will stop functioning after this change. However, this is not pythonic and correct way piping to character device Empty file is created using open and close call. Or pathlib.Path.touch It only "works" because '/dev/null' happens to return EOF immediately It's incidental, not designed. Similarly, using So, it okay to raise against the Character Device too. I did a github search of using shutil with /dev/null and I couldn't find any. |
Reviewed and approved. Thank you. |
The original issue just mentions sockets, but while documenting this I found it very confusing and inconsistent that device files didn't get the same treatment, so I figured I'd fix them all in one go.
📚 Documentation preview 📚: https://cpython-previews--142693.org.readthedocs.build/