Issue #21285 has been updated by Matthaus Owens.

Status changed from In Topic Branch Pending Review to Merged - Pending Release

merged at 
<https://github.com/puppetlabs/puppet-win32-ruby/commit/4f093ba1e0c77f44d41885828f41960897a86fe9>

----------------------------------------
Bug #21285: Facter.processorcount fails on Windows 64bit
https://projects.puppetlabs.com/issues/21285#change-95805

* Author: Maurizio De Santis
* Status: Merged - Pending Release
* Priority: Normal
* Assignee: 
* Category: windows
* Target version: 
* Keywords: windows
* 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.


Reply via email to