Skip to content

File.expand_path doesn't respect args encoding #3849

@ahorek

Description

@ahorek

Environment

jruby -v
jruby 9.1.0.0 (2.3.0) 2016-05-02 a633c63 Java HotSpot(TM) 64-Bit Server VM 25.92-b14 on 1.8.0_92-b14 +jit [mswin32-x86_64]
also doesn't work with jruby 9.0.5.0

java -version
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)

Expected Behavior

Path should be encoded in UTF8

Actual Behavior

C:\jruby-9.1.0.0\bin\devel>..\jruby -S -J-Dfile.encoding=UTF-8 bundle install
UTF-8 .bundle
UTF-8 .bundle
IBM852 C:/jruby-9.1.0.0/bin/devel
IBM852 C:/jruby-9.1.0.0/bin/devel
UTF-8 config
UTF-8 config
UTF-8 C:/jruby-9.1.0.0/bin/devel/.bundle
UTF-8 C:/jruby-9.1.0.0/bin/devel/.bundle
UTF-8 .bundle
UTF-8 .bundle
IBM852 C:/Users/Pavel RosickÔöť┼╗
UTF-8 .bundle
UTF-8 .bundle
IBM852 C:/jruby-9.1.0.0/bin/devel
IBM852 C:/jruby-9.1.0.0/bin/devel
UTF-8 config
UTF-8 config
UTF-8 C:/jruby-9.1.0.0/bin/devel/.bundle
UTF-8 C:/jruby-9.1.0.0/bin/devel/.bundle
UTF-8 .bundle
UTF-8 .bundle
<b>IBM852 C:/Users/Pavel RosickÔöť┼╗</b>
TypeError: no implicit conversion from nil to integer
                        [] at org/jruby/RubyString.java:2959
             chop_basename at C:/jruby-9.1.0.0/lib/ruby/stdlib/pathname.rb:45
                      plus at C:/jruby-9.1.0.0/lib/ruby/stdlib/pathname.rb:371
                         + at C:/jruby-9.1.0.0/lib/ruby/stdlib/pathname.rb:351
                      join at C:/jruby-9.1.0.0/lib/ruby/stdlib/pathname.rb:417
          user_bundle_path at C:/jruby-9.1.0.0/lib/ruby/gems/shared/gems/bundler-1.12.1/lib/bundler.rb:142
        global_config_file at C:/jruby-9.1.0.0/lib/ruby/gems/shared/gems/bundler-1.12.1/lib/bundler/settings.rb:216
                initialize at C:/jruby-9.1.0.0/lib/ruby/gems/shared/gems/bundler-1.12.1/lib/bundler/settings.rb:13
                  settings at C:/jruby-9.1.0.0/lib/ruby/gems/shared/gems/bundler-1.12.1/lib/bundler.rb:198
                    report at C:/jruby-9.1.0.0/lib/ruby/gems/shared/gems/bundler-1.12.1/lib/bundler/env.rb:28
  request_issue_report_for at C:/jruby-9.1.0.0/lib/ruby/gems/shared/gems/bundler-1.12.1/lib/bundler/friendly_errors.rb:74
                 log_error at C:/jruby-9.1.0.0/lib/ruby/gems/shared/gems/bundler-1.12.1/lib/bundler/friendly_errors.rb:40
      with_friendly_errors at C:/jruby-9.1.0.0/lib/ruby/gems/shared/gems/bundler-1.12.1/lib/bundler/friendly_errors.rb:100
                     <top> at C:/jruby-9.1.0.0/lib/ruby/gems/shared/gems/bundler-1.12.1/exe/bundle:19
                      load at org/jruby/RubyKernel.java:962
                     <top> at C:/jruby-9.1.0.0/bin/bundle:22

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions