Issue #21285 has been updated by Josh Cooper. Description updated Status changed from Unreviewed to Needs More Information
This is the same issue as #17010, but is now showing up in Facter. For some reason ruby expects file paths to be `ascii_compatible?` (see <https://bugs.ruby-lang.org/issues/7168>), and the win32-dir gem returns a UTF-16LE encoded string (wchar_t *). I don't understand why ruby requires that, but whatever, we tried... Can you see if the issue is resolved for you in ruby193 (and is now broken again in ruby 2.0)? Or if it's broken consistently in ruby193 and 2.0? Also, can you include the output of: <pre> C:\>wmic os get codeset, locale, oslanguage </pre> ---------------------------------------- Bug #21285: Facter.processorcount fails on Windows 64bit https://projects.puppetlabs.com/issues/21285#change-93101 * Author: Maurizio De Santis * Status: Needs More Information * Priority: Normal * Assignee: * Category: windows * Target version: * Keywords: * Branch: * Affected Facter version: 1.7.1 ---------------------------------------- I'm running facter 1.7.1, Ruby 64bit 2.0.0-p195 via RubyInstaller on Windows 7 64bit; running Facter.fact(:processorcount) I get this error: <pre> irb(main):002:0> Facter.fact(:processorcount) Encoding::CompatibilityError: path name must be ASCII-compatible (UTF-16LE): "C:\\ProgramData" from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/facter-1.7.1/lib/facter/util/config.rb:37:in `join' from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/facter-1.7.1/lib/facter/util/config.rb:37:in `external_facts_dirs' from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/facter-1.7.1/lib/facter/util/directory_loader.rb:46:in `default_loader' from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/facter-1.7.1/lib/facter/util/config.rb:8:in `ext_fact_loader' from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/facter-1.7.1/lib/facter.rb:56:in `collection' from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/facter-1.7.1/lib/facter.rb:112:in `block (2 levels) in singleton class' from (irb):2 from C:/Ruby200-x64/bin/irb:12:in `<main>' </pre> It works modifing Facter::Util::Config.windows_data_dir as follows: <pre> def self.windows_data_dir if Dir.const_defined? 'COMMON_APPDATA' then Dir::COMMON_APPDATA.encode('ASCII') else nil end end </pre> -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/groups/opt_out.
