From 65efdd5e109e07fc6d6004e79dcfa516d5285d17 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Mon, 16 May 2016 14:37:55 +0900 Subject: [PATCH 1/2] Suppress encoding related warnings This change suppresses warning messages about 800 lines on CI. --- lib/fluent/engine.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/fluent/engine.rb b/lib/fluent/engine.rb index f598d71049..eaac32f2f7 100644 --- a/lib/fluent/engine.rb +++ b/lib/fluent/engine.rb @@ -57,10 +57,6 @@ def init(system_config) @system_config = system_config BasicSocket.do_not_reverse_lookup = true - if defined?(Encoding) - Encoding.default_internal = 'ASCII-8BIT' if Encoding.respond_to?(:default_internal) - Encoding.default_external = 'ASCII-8BIT' if Encoding.respond_to?(:default_external) - end suppress_interval(system_config.emit_error_log_interval) unless system_config.emit_error_log_interval.nil? @suppress_config_dump = system_config.suppress_config_dump unless system_config.suppress_config_dump.nil? From 32790dc908f9364ac3ac99eb0d2e514a8f05b909 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Mon, 16 May 2016 17:33:32 +0900 Subject: [PATCH 2/2] Use -E options to set default_external and default_internal --- Rakefile | 1 + lib/fluent/supervisor.rb | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index 95632a6e92..ff5a5ad05d 100755 --- a/Rakefile +++ b/Rakefile @@ -16,6 +16,7 @@ Rake::TestTask.new(:base_test) do |t| t.test_files = Dir["test/**/test_*.rb"].sort t.verbose = false t.warning = false + t.ruby_opts = ["-Eascii-8bit:ascii-8bit"] end task :parallel_test do diff --git a/lib/fluent/supervisor.rb b/lib/fluent/supervisor.rb index 37546c62e3..4d733cd4d8 100644 --- a/lib/fluent/supervisor.rb +++ b/lib/fluent/supervisor.rb @@ -421,12 +421,14 @@ def supervise $log.info "starting fluentd-#{Fluent::VERSION}" if Fluent.windows? - fluentd_spawn_cmd = ServerEngine.ruby_bin_path + ' "' + $0.gsub('"', '""') + '" ' + fluentd_spawn_cmd = ServerEngine.ruby_bin_path + " -Eascii-8bit:ascii-8bit " + fluentd_spawn_cmd << ' "' + $0.gsub('"', '""') + '" ' $fluentdargv.each{|a| fluentd_spawn_cmd << ('"' + a.gsub('"', '""') + '" ') } else - fluentd_spawn_cmd = $0.shellescape + ' ' + fluentd_spawn_cmd = ServerEngine.ruby_bin_path + " -Eascii-8bit:ascii-8bit " + fluentd_spawn_cmd << $0.shellescape + ' ' $fluentdargv.each{|a| fluentd_spawn_cmd << (a.shellescape + " ") }