From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: raindrops-public@bogomips.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 60A8620276 for ; Tue, 2 Feb 2016 18:31:36 +0000 (UTC) From: Eric Wong To: raindrops-public@bogomips.org Subject: [RFC] linux: workaround Ruby 2.3 change Date: Tue, 2 Feb 2016 18:31:36 +0000 Message-Id: <20160202183136.21549-1-e@80x24.org> List-Id: File.readlink (and thus Pathname#realpath) returns the filesystem encoding (Encoding.find "filesystem"). The filesystem encoding defaults to the locale encoding, which tends to be UTF-8. This is true even on *nix filesystems which can have any byte besides "\0". ref: https://bugs.ruby-lang.org/issues/12034 ref: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/73593 --- lib/raindrops/linux.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/raindrops/linux.rb b/lib/raindrops/linux.rb index 7cfb653..a38fa64 100644 --- a/lib/raindrops/linux.rb +++ b/lib/raindrops/linux.rb @@ -47,6 +47,7 @@ module Raindrops::Linux if File.symlink?(path) link = path path = Pathname.new(link).realpath.to_s + path.force_encoding(Encoding::BINARY) if defined?(Encoding) rv[link] = rv[path] # vivify ListenerStats else rv[path] # vivify ListenerStats -- EW