Forum: Ruby-core [ruby-trunk - Bug #8611][Open] Minitest encoding problems.

Df9d48b6e2ae6cdedf4c39c2e58df851?d=identicon&s=25 boris_stitnicky (Boris Stitnicky) (Guest)
on 2013-07-08 08:55
(Received via mailing list)
Issue #8611 has been reported by boris_stitnicky (Boris Stitnicky).

----------------------------------------
Bug #8611: Minitest encoding problems.
https://bugs.ruby-lang.org/issues/8611

Author: boris_stitnicky (Boris Stitnicky)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: 2.0.0.latest patch
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


A long standing annoying misfeature of minitest is the problem with
encoding, which I have solved by patching the backtrace.join line in
units.rb, #puke method with map{ |str| str.force_encoding( "UTF-8 ) }.
If I don't do this, the tests in irb won't run, instead I get a
complaint about "ASCII 8" versus "UTF-8" incompatibility. Only happens
when one extensively uses UTF characters when coding, an annoying
intermittent error.
Df9d48b6e2ae6cdedf4c39c2e58df851?d=identicon&s=25 boris_stitnicky (Boris Stitnicky) (Guest)
on 2013-07-08 08:57
(Received via mailing list)
Issue #8611 has been updated by boris_stitnicky (Boris Stitnicky).


Sorry for a terse report and lack of supporting materials, I'm extremely
busy now.
----------------------------------------
Bug #8611: Minitest encoding problems.
https://bugs.ruby-lang.org/issues/8611#change-40360

Author: boris_stitnicky (Boris Stitnicky)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: 2.0.0.latest patch
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


A long standing annoying misfeature of minitest is the problem with
encoding, which I have solved by patching the backtrace.join line in
units.rb, #puke method with map{ |str| str.force_encoding( "UTF-8 ) }.
If I don't do this, the tests in irb won't run, instead I get a
complaint about "ASCII 8" versus "UTF-8" incompatibility. Only happens
when one extensively uses UTF characters when coding, an annoying
intermittent error.
9361878d459f1709feec780518946ee5?d=identicon&s=25 naruse (Yui NARUSE) (Guest)
on 2013-07-09 10:34
(Received via mailing list)
Issue #8611 has been updated by naruse (Yui NARUSE).

Status changed from Open to Feedback

You know, this must have reproducible code.
----------------------------------------
Bug #8611: Minitest encoding problems.
https://bugs.ruby-lang.org/issues/8611#change-40379

Author: boris_stitnicky (Boris Stitnicky)
Status: Feedback
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: 2.0.0.latest patch
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


A long standing annoying misfeature of minitest is the problem with
encoding, which I have solved by patching the backtrace.join line in
units.rb, #puke method with map{ |str| str.force_encoding( "UTF-8 ) }.
If I don't do this, the tests in irb won't run, instead I get a
complaint about "ASCII 8" versus "UTF-8" incompatibility. Only happens
when one extensively uses UTF characters when coding, an annoying
intermittent error.
Df9d48b6e2ae6cdedf4c39c2e58df851?d=identicon&s=25 boris_stitnicky (Boris Stitnicky) (Guest)
on 2013-07-22 00:06
(Received via mailing list)
Issue #8611 has been updated by boris_stitnicky (Boris Stitnicky).


All right, I am no longer getting the same error since I patched it for
myself, but to illustrate what I am talking about, here is another way
to crash irb in basically the same way, pointing to a wider problem. It
can be illustrated with Pyper gem that I wrote as follows:

gem install 'pyper'
a = [1, 3, 4, 3, 0, 3, 1]
a.τsπ( :uniq ).χOixπ.χriXgζmEπ

NoMethodError ensues, that crashes the irb:

NoMethodError: undefined method `map' for 0:Fixnum
/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 `<main>'

----------------------------------------
Bug #8611: Minitest encoding problems.
https://bugs.ruby-lang.org/issues/8611#change-40600

Author: boris_stitnicky (Boris Stitnicky)
Status: Feedback
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: 2.0.0.latest patch
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


A long standing annoying misfeature of minitest is the problem with
encoding, which I have solved by patching the backtrace.join line in
units.rb, #puke method with map{ |str| str.force_encoding( "UTF-8 ) }.
If I don't do this, the tests in irb won't run, instead I get a
complaint about "ASCII 8" versus "UTF-8" incompatibility. Only happens
when one extensively uses UTF characters when coding, an annoying
intermittent error.
This topic is locked and can not be replied to.