Bug #9017
closedirb crash with message "... 'join': incompatible character encodings: ASCII-8BIT and UTF-8 ..."
Description
With Pyper gem that I wrote, irb crashes as follows:
require 'pyper' # gem install pyper if necessary
[''].τmsτ # τ is Greek tau
#=> irb crashes:
ArgumentError: no method name given
/usr/local/lib/ruby/2.0.0/irb.rb:526:in join': incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError) from /usr/local/lib/ruby/2.0.0/irb.rb:526:in
block (2 levels) in eval_input'
from /usr/local/lib/ruby/2.0.0/irb.rb:624:in signal_status' from /usr/local/lib/ruby/2.0.0/irb.rb:489:in
block in eval_input'
from /usr/local/lib/ruby/2.0.0/irb/ruby-lex.rb:247:in block (2 levels) in each_top_level_statement' from /usr/local/lib/ruby/2.0.0/irb/ruby-lex.rb:233:in
loop'
from /usr/local/lib/ruby/2.0.0/irb/ruby-lex.rb:233:in block in each_top_level_statement' from /usr/local/lib/ruby/2.0.0/irb/ruby-lex.rb:232:in
catch'
from /usr/local/lib/ruby/2.0.0/irb/ruby-lex.rb:232:in each_top_level_statement' from /usr/local/lib/ruby/2.0.0/irb.rb:488:in
eval_input'
from /usr/local/lib/ruby/2.0.0/irb.rb:397:in block in start' from /usr/local/lib/ruby/2.0.0/irb.rb:396:in
catch'
from /usr/local/lib/ruby/2.0.0/irb.rb:396:in start' from /usr/local/bin/irb:12:in
'
ruby -v
#=> ruby 2.0.0p247 (2013-06-27 revision 41674) [i686-linux]
irb -v
#=> 0.9.6(09/06/30)
Updated by jeremyevans0 (Jeremy Evans) over 4 years ago
- Status changed from Open to Closed
- Backport deleted (
1.9.3: UNKNOWN, 2.0.0: UNKNOWN)
This was fixed between Ruby 2.0 and 2.1:
$ irb20 -I pyper/lib -r pyper
irb(main):001:0> [''].τmsτ # τ is Greek tau
ArgumentError: no method name given
/usr/local/lib/ruby/2.0/irb.rb:526:in `join': incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)
from /usr/local/lib/ruby/2.0/irb.rb:526:in `block (2 levels) in eval_input'
from /usr/local/lib/ruby/2.0/irb.rb:624:in `signal_status'
from /usr/local/lib/ruby/2.0/irb.rb:489:in `block in eval_input'
from /usr/local/lib/ruby/2.0/irb/ruby-lex.rb:247:in `block (2 levels) in each_top_level_statement'
from /usr/local/lib/ruby/2.0/irb/ruby-lex.rb:233:in `loop'
from /usr/local/lib/ruby/2.0/irb/ruby-lex.rb:233:in `block in each_top_level_statement'
from /usr/local/lib/ruby/2.0/irb/ruby-lex.rb:232:in `catch'
from /usr/local/lib/ruby/2.0/irb/ruby-lex.rb:232:in `each_top_level_statement'
from /usr/local/lib/ruby/2.0/irb.rb:488:in `eval_input'
from /usr/local/lib/ruby/2.0/irb.rb:397:in `block in start'
from /usr/local/lib/ruby/2.0/irb.rb:396:in `catch'
from /usr/local/lib/ruby/2.0/irb.rb:396:in `start'
from /usr/local/bin/irb20:12:in `<main>'
$ irb21 -I pyper/lib -r pyper
irb(main):001:0> [''].τmsτ # τ is Greek tau
ArgumentError: no method name given
from (eval):9:in `block in τmsτ'
from (eval):6:in `map'
from (eval):6:in `τmsτ'
from /path/lib/pyper.rb:165:in `method_missing'
from (irb):1
from /usr/local/bin/irb21:11:in `<main>'