Bug #9966

Encoding.find(symbol)の動作がrdocと異なる

Added by Wataru Kimura 8 months ago. Updated 6 months ago.

[ruby-dev:48308]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:ruby 2.2.0dev (2014-06-20 trunk 46480) [x86_64-darwin13] Backport:2.0.0: DONE, 2.1: DONE

Description

http://www.ruby-doc.org/core-2.1.2/Encoding.html#method-c-find

Encding.find()は、stringまたはsymbolを受け付けるとrdocにありますが、
symbolを渡したときはTypeErrorになります。これは意図された動作でしょうか?

% /usr/local/stow/ruby-2.2-dev/bin/ruby -e 'Encoding.find(:Shift_JIS)' 
-e:1:in `find': no implicit conversion of Symbol into String (TypeError)
    from -e:1:in `<main>'

ruby-2.1.2とruby-2.0.0p481でも同様にTypeErrorとなります。

Associated revisions

Revision 46481
Added by Nobuyoshi Nakada 8 months ago

encoding.c: fix rdoc [ci skip]

  • encoding.c (enc_find): [DOC] never accepted a symbol. [Bug #9966]

Revision 46481
Added by Nobuyoshi Nakada 8 months ago

encoding.c: fix rdoc [ci skip]

  • encoding.c (enc_find): [DOC] never accepted a symbol. [Bug #9966]

Revision 46670
Added by Usaku NAKAMURA 8 months ago

merge revision(s) 46481: [Backport #9966]

* encoding.c (enc_find): [DOC] never accepted a symbol.
   [Bug #9966]

Revision 47216
Added by Tomoyuki Chikanaga 6 months ago

merge revision(s) r46481: [Backport #9966]

* encoding.c (enc_find): [DOC] never accepted a symbol.
   [Bug #9966]

History

#1 Updated by Shota Fukumori 8 months ago

コミットを追ってみましたが最初から rdoc が間違ってたんじゃないか説が…
どうなんでしょう?

#2 Updated by Nobuyoshi Nakada 8 months ago

  • Category set to doc

Symbolを想定してたことはないですね。

#3 Updated by Nobuyoshi Nakada 8 months ago

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

Applied in changeset r46481.


encoding.c: fix rdoc [ci skip]

  • encoding.c (enc_find): [DOC] never accepted a symbol. [Bug #9966]

#4 Updated by Tomoyuki Chikanaga 6 months ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE

Backported into ruby_2_1 branch at r47216.

#5 Updated by Tomoyuki Chikanaga 6 months ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: DONE to 2.0.0: DONE, 2.1: DONE

And already backported into ruby_2_0_0 branch at r46670.

Also available in: Atom PDF