Project

General

Profile

Backport #5733

Error when loading a converter

Added by Anonymous about 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:41556]

Description

I think this might be a bug, but I'm not sure. The following code
raises an exception:

 # encoding:utf-8

 require 'minitest/autorun'


 class NewConverterTest < MiniTest::Unit::TestCase
   def setup
     @old_internal = Encoding.default_internal
     @old_external = Encoding.default_external
   end

   def teardown
     Encoding.default_internal = @old_internal
     Encoding.default_external = @old_external
   end

   def test_iso_8859_utf_8_change_encodings
     Encoding.default_internal = 'UTF-8'
     Encoding.default_external = 'ISO-8859-1'

     Encoding::Converter.new 'ISO-8859-1', 'UTF-8' # boom!
   end
 end

Exception:

   1) Error:
 test_iso_8859_utf_8_change_encodings(NewConverterTest):
 Encoding::ConverterNotFoundError: code converter not found (ISO-8859-1 to UTF-8)
     test.rb:21:in `initialize'
     test.rb:21:in `new'
     test.rb:21:in `test_iso_8859_utf_8_change_encodings'
     /Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:976:in `run'
     /Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:814:in `block in _run_suite'
     /Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:807:in `map'
     /Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:807:in `_run_suite'
     /Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:797:in `block in _run_suites'
     /Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:797:in `map'
     /Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:797:in `_run_suites'
     /Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:773:in `_run_anything'
     /Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:936:in `run_tests'
     /Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:923:in `block in _run'
     /Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:922:in `each'
     /Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:922:in `_run'
     /Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:911:in `run'
     /Users/aaron/.local/lib/ruby/1.9.1/minitest/unit.rb:691:in `block in autorun'

Is this intentional? If so, why? Thank you.

--
Aaron Patterson
http://tenderlovemaking.com/


Files

noname (500 Bytes) noname Anonymous, 12/09/2011 10:44 AM

Associated revisions

Revision 8e411664
Added by naruse (Yui NARUSE) about 7 years ago

  • file.c (file_path_convert): don't convert it when the path string is ascii only. [ruby-core:41556] [Bug #5733] tests are contributed by nobu.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 33991
Added by naruse (Yui NARUSE) about 7 years ago

  • file.c (file_path_convert): don't convert it when the path string is ascii only. [ruby-core:41556] [Bug #5733] tests are contributed by nobu.

Revision 33991
Added by naruse (Yui NARUSE) about 7 years ago

  • file.c (file_path_convert): don't convert it when the path string is ascii only. [ruby-core:41556] [Bug #5733] tests are contributed by nobu.

Revision 33991
Added by naruse (Yui NARUSE) about 7 years ago

  • file.c (file_path_convert): don't convert it when the path string is ascii only. [ruby-core:41556] [Bug #5733] tests are contributed by nobu.

Revision 33991
Added by naruse (Yui NARUSE) about 7 years ago

  • file.c (file_path_convert): don't convert it when the path string is ascii only. [ruby-core:41556] [Bug #5733] tests are contributed by nobu.

Revision 33991
Added by naruse (Yui NARUSE) about 7 years ago

  • file.c (file_path_convert): don't convert it when the path string is ascii only. [ruby-core:41556] [Bug #5733] tests are contributed by nobu.

Revision 33991
Added by naruse (Yui NARUSE) about 7 years ago

  • file.c (file_path_convert): don't convert it when the path string is ascii only. [ruby-core:41556] [Bug #5733] tests are contributed by nobu.

Revision f869ed2f
Added by naruse (Yui NARUSE) over 6 years ago

merge revision(s) 33991:

* file.c (file_path_convert): don't convert it when the path string is
  ascii only. [ruby-core:41556] [Bug #5733]
  tests are contributed by nobu.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@36735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 36735
Added by naruse (Yui NARUSE) over 6 years ago

merge revision(s) 33991:

* file.c (file_path_convert): don't convert it when the path string is
  ascii only. [ruby-core:41556] [Bug #5733]
  tests are contributed by nobu.

History

#1

Updated by naruse (Yui NARUSE) about 7 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r33991.
, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • file.c (file_path_convert): don't convert it when the path string is ascii only. [ruby-core:41556] [Bug #5733] tests are contributed by nobu.
#2

Updated by ktsj (Kazuki Tsujimoto) over 6 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby trunk to Backport193
  • Status changed from Closed to Assigned
  • Assignee set to naruse (Yui NARUSE)

Could you backport it for 1.9.3?

#3

Updated by naruse (Yui NARUSE) over 6 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r36735.
, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 33991:

* file.c (file_path_convert): don't convert it when the path string is
  ascii only. [ruby-core:41556] [Bug #5733]
  tests are contributed by nobu.

Also available in: Atom PDF