summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_glob.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-03-13 09:40:28 (GMT)
committerGitHub <noreply@github.com>2024-03-13 09:40:28 (GMT)
commitaa7bcf284f006434b07839d82f325618f7a5c06c (patch)
treef295c0cc868042e4096466ce97a53e0dad05d25d /Lib/test/test_glob.py
parent8332e85b2f079e8b9334666084d1f8495cff25c1 (diff)
downloadcpython-aa7bcf284f006434b07839d82f325618f7a5c06c.zip
cpython-aa7bcf284f006434b07839d82f325618f7a5c06c.tar.gz
cpython-aa7bcf284f006434b07839d82f325618f7a5c06c.tar.bz2
gh-116401: Fix blocking os.fwalk() and shutil.rmtree() on opening a named pipe (GH-116421)
Diffstat (limited to 'Lib/test/test_glob.py')
-rw-r--r--Lib/test/test_glob.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py
index 8b2ea8f..1fdf281 100644
--- a/Lib/test/test_glob.py
+++ b/Lib/test/test_glob.py
@@ -344,6 +344,18 @@ class GlobTests(unittest.TestCase):
eq(self.rglob('nonexistent', '*'), [])
eq(self.rglob('nonexistent', '**'), [])
+ @unittest.skipUnless(hasattr(os, "mkfifo"), 'requires os.mkfifo()')
+ @unittest.skipIf(sys.platform == "vxworks",
+ "fifo requires special path on VxWorks")
+ def test_glob_named_pipe(self):
+ path = os.path.join(self.tempdir, 'mypipe')
+ os.mkfifo(path)
+ self.assertEqual(self.rglob('mypipe'), [path])
+ self.assertEqual(self.rglob('mypipe*'), [path])
+ self.assertEqual(self.rglob('mypipe', ''), [])
+ self.assertEqual(self.rglob('mypipe', 'sub'), [])
+ self.assertEqual(self.rglob('mypipe', '*'), [])
+
def test_glob_many_open_files(self):
depth = 30
base = os.path.join(self.tempdir, 'deep')