Issue #21285 has been updated by Josh Cooper.

Interestingly, I get different results when run via ruby and bundler (on fr_FR):

<pre>
C:\work\facter>ruby -S facter --trace
c:/work/facter/lib/facter/util/config.rb:38:in `join': string contains null 
byte (ArgumentError)
        from c:/work/facter/lib/facter/util/config.rb:38:in 
`external_facts_dirs'
        from c:/work/facter/lib/facter/util/directory_loader.rb:46:in 
`default_loader'
        from c:/work/facter/lib/facter/util/config.rb:8:in `ext_fact_loader'
        from c:/work/facter/lib/facter.rb:65:in `collection'
        from c:/work/facter/lib/facter.rb:186:in `to_hash'
        from c:/work/facter/lib/facter/application.rb:45:in `run'
        from c:/work/facter/bin/facter:74:in `&lt;main>'
</pre>

<pre>
C:\work\facter>bundle exec facter hostname
WIN-616UKRQP00N
</pre>

I presume bundler is changing the default encoding in some way, which is just 
awesome, because we use bundler for our spec tests...

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

* Author: Maurizio De Santis
* Status: Accepted
* 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