From 7a3fe796e5d558fa0a8814be0088f0b562bccf6d Mon Sep 17 00:00:00 2001 From: Shizuo Fujita Date: Fri, 7 Mar 2025 09:55:01 +0900 Subject: [PATCH] parser: fix file path into URI#open for Windows (#4855) **Which issue(s) this PR fixes**: Fixes # **What this PR does / why we need it**: This patch will fix the problem in https://github.com/fluent/fluentd/pull/4848 `u.path` has the file path without a drive letter in Windows environment. If Fluentd is worked on `c` drive and config file exists in `d` drive, it can't parse config file, I think. **Docs Changes**: **Release Note**: Signed-off-by: Shizuo Fujita Signed-off-by: Kentaro Hayashi --- lib/fluent/config/parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fluent/config/parser.rb b/lib/fluent/config/parser.rb index 792a250153..bc9f51d10a 100644 --- a/lib/fluent/config/parser.rb +++ b/lib/fluent/config/parser.rb @@ -107,7 +107,7 @@ def process_include(attrs, elems, uri, allow_include = true) # - uri is 'c:/path/to/file' # - u.path is '/path/to/file' and u.scheme is 'c' # Therefore, the condition of the if statement above is not met and it is handled here. - File.open(u.path, &parser_proc) + File.open(uri, &parser_proc) end end