diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 01746f7708..018877e84e 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -428,7 +428,7 @@ class Pathname # https://bugs.ruby-lang.org/issues/9915 prepend Module.new { def inspect - super.force_encoding(instance_variable_get(:@path).encoding) + super.force_encoding(@path.encoding) end } end