Issue #21285 has been updated by Josh Cooper.

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

My mistake, I get the same results with bundler and not. Here's a simpler 
example:

<pre>
C:\work\win32-dir>type Gemfile
source "https://rubygems.org";

gem 'win32-dir', :path => File.expand_path("..", __FILE__)
gem 'ffi'

C:\work\win32-dir>bundle install
Resolving dependencies...
Using ffi (1.9.0)
Using win32-dir (0.4.2) from source at .
Using bundler (1.3.5)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

C:\work\win32-dir>bundle exec ruby -e "require 'win32/dir'; puts 
Dir::COMMON_APPDATA.encoding"
UTF-16LE
</pre>

And

<pre>
C:\work\win32-dir>set RUBYLIB=c:\work\win32-dir\lib

C:\work\win32-dir> ruby -e "require 'win32/dir'; puts 
Dir::COMMON_APPDATA.encoding"
UTF-16LE
</pre>

In any case, a new gem should be out today: 
<https://github.com/djberg96/win32-dir/pull/4#issuecomment-21488150>

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

* 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