Commit 8ac9690
authored
test_configdsl: fix test using pipe command (#5159)
**Which issue(s) this PR fixes**:
Fixes #5148
**What this PR does / why we need it**:
Since Ruby 4.0, When we give pipe command in `Kernel.open`, it causes an
error.
```
$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]
-e:1: warning: Calling Kernel#open with a leading '|' is deprecated and will be removed in Ruby 4.0; use IO.popen instead
"Linux UM890 6.17.1-0-MANJARO #1 SMP PREEMPT_DYNAMIC Tue, 07 Oct 2025 07:57:35 +0000 x86_64 GNU/Linux\n"
$ ruby -w -v -e "Kernel.open('| uname -a'){|out| p out.read }"
ruby 4.0.0dev (2025-11-20T00:03:23Z master 167c3dbaa0) +PRISM [x86_64-linux]
-e:1:in 'File#initialize': No such file or directory @ rb_sysopen - | uname -a (Errno::ENOENT)
from -e:1:in 'Kernel.open'
from -e:1:in '<main>'
```
This path will save the command's result in temporary files and use them
instead due to avoid the error.
**Docs Changes**:
N/A
**Release Note**:
N/A
Signed-off-by: Shizuo Fujita <[email protected]>1 parent 08f8c24 commit 8ac9690
1 file changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
110 | 115 | | |
111 | | - | |
| 116 | + | |
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
| |||
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
| 152 | + | |
| 153 | + | |
147 | 154 | | |
148 | 155 | | |
0 commit comments