-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Closed
Copy link
Milestone
Description
Environment
- JRuby version:
jruby 9.2.4.0 (2.5.0) 2018-11-13 8faff06 Java HotSpot(TM) 64-Bit Server VM 25.152-b16 on 1.8.0_152-b16 +jit [darwin-x86_64] - Operating system and platform:
Darwin inquanok 17.7.0 Darwin Kernel Version 17.7.0: Wed Oct 10 23:06:14 PDT 2018; root:xnu-4570.71.13~1/RELEASE_X86_64 x86_64
Expected Behavior
With the following script: (note, the block is largely irrelevant, since jRuby never actually gets to it, but I wanted to show that we are writing, rewinding, setting encoding and then yielding it to a caller that reads from it.):
#!/usr/bin/env ruby
require 'Tempfile'
# aws-sdk S3.get_object reads/writes in byte chunks which may or may align with UTF-8 codepoints
Tempfile.open('prefix_', '/tmp', encoding: 'ASCII-8BIT:ASCII-8BIT') do |file|
file.puts $$
file.rewind
file.set_encoding('UTF-8')
# yield file
puts file.read
endThis works in RMI 2.5.1.
Actual Behavior
It appears that jRuby 9.2.4.0 does not honor the 3rd argument (9.1.x.0 all did):
% RBENV_VERSION=2.5.1 ruby /tmp/tempfile.rb
30919
% RBENV_VERSION=jruby-9.2.4.0 ruby /tmp/tempfile.rb
ArgumentError: wrong number of arguments (3 for 2)
<main> at /tmp/tempfile.rb:5
% RBENV_VERSION=jruby-9.1.17.0 ruby /tmp/tempfile.rb
32394
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels