Environment Information
$ ruby -v
jruby 10.1.0.0 (4.0.0) 2026-04-20 32f988b78c OpenJDK 64-Bit Server VM 25.0.2 on 25.0.2 +indy +jit [arm64-darwin]
$ uname -a
Darwin $hostname 25.4.0 Darwin Kernel Version 25.4.0: Thu Mar 19 19:33:25 PDT 2026; root:xnu-12377.101.15~1/RELEASE_ARM64_T6041 arm64
Expected Behavior
On MRI, Pathname's error message indicates that there is an issue with the pathname:
$ cat test.rb
require 'pathname'
Pathname.new("not\0allowed")
$ ruby -v
ruby 4.0.3 (2026-04-21 revision 85ddef263a) +PRISM [arm64-darwin25]
$ ruby test.rb
test.rb:2:in 'Pathname#initialize': path name contains null byte (ArgumentError)
Pathname.new("not\0allowed")
^^^^^^^^^^^^^^
from test.rb:2:in '<main>'
And previous versions of JRuby provide a similar error message (though uses the one word "pathname" instead of "path name"):
$ ruby -v
jruby 10.0.5.0 (3.4.5) 2026-04-06 5db1ba72f3 OpenJDK 64-Bit Server VM 25.0.2 on 25.0.2 +indy +jit [arm64-darwin]
$ ruby test.rb
ArgumentError: pathname contains null byte
initialize at org/jruby/ext/pathname/RubyPathname.java:167
new at org/jruby/RubyClass.java:1050
<main> at test.rb:2
Actual Behavior
The error message in JRuby 10.1.0.0 refers a more generic string, not pathname:
$ ruby -v
jruby 10.1.0.0 (4.0.0) 2026-04-20 32f988b78c OpenJDK 64-Bit Server VM 25.0.2 on 25.0.2 +indy +jit [arm64-darwin]
$ ruby test.rb
ArgumentError: string contains null byte
initialize at org/jruby/ext/pathname/RubyPathname.java:168
new at org/jruby/RubyClass.java:1058
<main> at test.rb:2
Claude indicates that this change was introduced in f6318a9
Environment Information
Expected Behavior
On MRI,
Pathname's error message indicates that there is an issue with the pathname:And previous versions of JRuby provide a similar error message (though uses the one word "pathname" instead of "path name"):
Actual Behavior
The error message in JRuby 10.1.0.0 refers a more generic string, not pathname:
Claude indicates that this change was introduced in f6318a9