[#41278] [BUG:1.9] BINARY should not be ASCII-compatible — Yugui <yugui@...>

WXVndWkbJEIkRyQ5ISMbKEIKCgo+IBskQiRHISIkKiQqJGAkTSQzJDMkXiRHJE41RE9AJEclKyVQ

15 messages 2010/05/11

[#41407] [Bug #3339] win32ole test failure — Usaku NAKAMURA <redmine@...>

Bug #3339: win32ole test failure

20 messages 2010/05/25
[#41411] Re: [Bug #3339] win32ole test failure — Masaki Suketa <masaki.suketa@...> 2010/05/25

助田です。

[#41412] Re: [Bug #3339] win32ole test failure — "U.Nakamura" <usa@...> 2010/05/25

こんにちは、なかむら(う)です。

[ruby-dev:41471] Re: NoMethodErrorなどのmessage

From: Masatoshi SEKI <m_seki@...>
Date: 2010-05-30 07:09:41 UTC
List: ruby-dev #41471
=1B$B31$H$$$$$^$9!#=1B(B

=1B$B$^$D$b$H$5$s!"$*JV;v$"$j$,$H$&$4$6$$$^$9!#=1B(B

On 2010/05/30, at 15:19, Yukihiro Matsumoto wrote:

> =1B$B$^$D$b$H=1B(B =1B$B$f$-$R$m$G$9=1B(B
>=20
> In message "Re: [ruby-dev:41329] NoMethodError=1B$B$J$I$N=1B(Bmessage"
>    on Sun, 16 May 2010 23:06:00 +0900, Masatoshi SEKI =
<m_seki@mva.biglobe.ne.jp> writes:
>=20
> |=1B$B$A$g$C$HA0$+$i=1B(BRWiki=1B$B$H$$$&=1B(BWiki=1B$BIw$N%"%W%j%1!<%7%=
g%s$r=1B(B
> |=1B$B=3Dq$$$F$$$^$9!#=1B(B
> =
|=1B$B$?$/$5$s$N%*%V%8%'%/%H$r;2>H$7$F$$$k=1B(BRWiki=1B$B$N%*%V%8%'%/%H$K!=
"=1B(B
> |irb=1B$B$GBPOCE*$K%a%C%;!<%8$rAw$k$3$H$,$h$/$"$k$N$G$9$,!"=1B(B
> |=1B$B$=3D$N:]$K%a%=3D%C%IL>$r4V0c$($k$H$H$F$bD9$$;~4VBT$?$5$l$F=1B(B
> |=1B$B:$$C$F$$$^$9!#=1B(B
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BdRuby=1B$B$N@-<A>e!"=1B(Binspect=1B$B$,F=
bIt$G8F$S=3DP$9=1B(B
> to_s=1B$B$J$I$,%M%C%H%o!<%/$r1[$($k$N$G!"!V$H$F$bD9$$!W$N$G$7$g$&=1B(B
> =1B$B$+!#$b$7!"8e<T$G$"$l$P!"=1B(BdRuby=1B$BB&$G%W%m%/%7!<$K;E3]$1$r$7$F=
=1B(B
> =
dRuby=1B$B%*%V%8%'%/%H$N=1B(Binspect=1B$B$O%M%C%H%o!<%/$r1[$($J$$$h$&$K$9$=
k=1B(B
> =1B$B<j$b$"$j$^$9$h$M!#=1B(B
>=20


=
=1B$B$H$F$bD9$$$C$W$j$O!"=1B(BRWiki=1B$B$N%W%m%;%9$,=1B(B1G=1B$B$rD6$($k$s=
$G$9$,=1B(B
=1B$B$=3D$N:,$K$J$k%*%V%8%'%/%H$X$N=1B(BNoMethodError=1B$B$N$H$-$J$I$K=1B(=
B
=1B$B$H$F$bBT$?$5$l$^$9!"$C$F46$8$G$9!#=1B(B


=1B$B<+?.$NL5$5$K$O<+?.$,$"$k$N$G!":G=3Di$K=1B(BdRuby=1B$B$r5?$$$^$7$?$,!"=
=1B(B
=1B$B%j%b!<%H$G$J$/$F$bCY$$$h$&$G$9!#=1B(B

nme.rb
--
a =3D Array.new(ARGV.shift.to_i)

begin
  a.foo
rescue
  Marshal.dump($!)
end
--

=
=1B$B$3$s$J$N$r=3Dq$$$F!"=1B(Bprofile=1B$B$H$k$H=1B(Binspect=1B$B$,8F$P$l$=
F$$$k$N$,$o$+$j$^$9!#=1B(B

% ruby -r profile nme.rb 10000
  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
 59.26     0.16      0.16        1   160.00   260.00  Array#inspect
 37.04     0.26      0.10    10000     0.01     0.01  NilClass#inspect
  3.70     0.27      0.01        1    10.00    10.00  Symbol#to_s
  0.00     0.27      0.00        1     0.00     0.00  Class#new
  0.00     0.27      0.00        1     0.00     0.00  =
NoMethodError#initialize
  0.00     0.27      0.00        1     0.00     0.00  =
Exception#exception
  0.00     0.27      0.00        1     0.00     0.00  =
NameError::message#!
  0.00     0.27      0.00        1     0.00     0.00  =
Exception#backtrace
  0.00     0.27      0.00        1     0.00     0.00  String#to_i
  0.00     0.27      0.00        1     0.00     0.00  =
NameError#initialize
  0.00     0.27      0.00        1     0.00   270.00  Marshal.dump
  0.00     0.27      0.00        1     0.00     0.00  =
Kernel.method_missing
  0.00     0.27      0.00        1     0.00     0.00  =
Exception#set_backtrace
  0.00     0.27      0.00        1     0.00     0.00  =
Exception#initialize
  0.00     0.27      0.00        1     0.00   270.00  =
NameError::message#_dump
  0.00     0.27      0.00        1     0.00     0.00  Array#initialize
  0.00     0.27      0.00        1     0.00     0.00  Array#shift
  0.00     0.27      0.00        1     0.00   270.00  #toplevel

% ruby -r profile nme.rb 1
  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
  0.00     0.00      0.00        1     0.00     0.00  Array#inspect
  0.00     0.00      0.00        1     0.00     0.00  =
Kernel.method_missing
  0.00     0.00      0.00        1     0.00     0.00  Marshal.dump
  0.00     0.00      0.00        1     0.00     0.00  String#to_i
  0.00     0.00      0.00        1     0.00     0.00  =
NoMethodError#initialize
  0.00     0.00      0.00        1     0.00     0.00  =
Exception#exception
  0.00     0.00      0.00        1     0.00     0.00  =
NameError::message#!
  0.00     0.00      0.00        1     0.00     0.00  =
Exception#backtrace
  0.00     0.00      0.00        1     0.00     0.00  Class#new
  0.00     0.00      0.00        1     0.00     0.00  =
NameError#initialize
  0.00     0.00      0.00        1     0.00     0.00  Symbol#to_s
  0.00     0.00      0.00        1     0.00     0.00  NilClass#inspect
  0.00     0.00      0.00        1     0.00     0.00  =
Exception#set_backtrace
  0.00     0.00      0.00        1     0.00     0.00  =
Exception#initialize
  0.00     0.00      0.00        1     0.00     0.00  =
NameError::message#_dump
  0.00     0.00      0.00        1     0.00     0.00  Array#initialize
  0.00     0.00      0.00        1     0.00     0.00  Array#shift
  0.00     0.01      0.00        1     0.00    10.00  #toplevel

=
=1B$B$G!"=1B(BMarshal.dump=1B$B$r%3%a%s%H%"%&%H$9$k$H<!$N$h$&$K=1B(Binspec=
t=1B$B$O8F$P$l$^$;$s!#=1B(B

nme2.rb
--
a =3D Array.new(ARGV.shift.to_i)

begin
  a.foo
rescue
  # Marshal.dump($!)
end
--

% ruby -r profile nme2.rb 10000
  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
  0.00     0.00      0.00        1     0.00     0.00  =
Kernel.method_missing
  0.00     0.00      0.00        1     0.00     0.00  String#to_i
  0.00     0.00      0.00        1     0.00     0.00  =
NoMethodError#initialize
  0.00     0.00      0.00        1     0.00     0.00  =
Exception#exception
  0.00     0.00      0.00        1     0.00     0.00  =
NameError::message#!
  0.00     0.00      0.00        1     0.00     0.00  =
Exception#backtrace
  0.00     0.00      0.00        1     0.00     0.00  Class#new
  0.00     0.00      0.00        1     0.00     0.00  =
NameError#initialize
  0.00     0.00      0.00        1     0.00     0.00  =
Exception#set_backtrace
  0.00     0.00      0.00        1     0.00     0.00  =
Exception#initialize
  0.00     0.00      0.00        1     0.00     0.00  Array#initialize
  0.00     0.00      0.00        1     0.00     0.00  Array#shift
  0.00     0.01      0.00        1     0.00    10.00  #toplevel



> |=1B$B$=3D$l$GDs0F$G$9!#=1B(B
> |
> |inspect=1B$B$O8F$P$:$K!"$$$D$b=1B(Brb_any_to_s()=1B$B!"$"$k$$$O=1B(B
> |
> |#<=1B$B%/%i%9L>=1B(B:=1B$B%*%V%8%'%/%H=1B(Bid>=20
> |
> |=1B$B$N7A<0=1B(B(=1B$B$J$s$F$$$&$N=1B(B?)=1B$B$r%a%C%;!<%8$KF~$l$k$N$O$=
I$&$G=1B(B
> |=1B$B$7$g$&$+!)=1B(B
>=20
> =1B$B$=3D$l$@$H=1B(Bnil=1B$B$d=1B(Bfalse=1B$B!"=1B(BFixnum=1B$B$N$h$&$J$=
b$N$^$G=1B(B
>=20
> #<=1B$B%/%i%9L>=1B(B:=1B$B%*%V%8%'%/%H=1B(Bid>=20
>=20
> =1B$B$K$J$C$A$c$$$^$9$+$i$M$(!#=1B(B




=1B$B$=3D$l$G!"=1B(Berror.c=1B$B$N=1B(Bname_err_mesg_to_str()=1B$B$rFI$_$^=
$7$?!#=1B(B

1.8=1B$B7O$O$3$s$J46$8$G$9!#=1B(B1.9=1B$B$b$[$\F1MM$G$9!#=1B(B

nil, true, false=1B$B$O%1%"$5$l$F$k$_$?$$!#=1B(B

default:=1B$B$G=1B(Binspect=1B$B$r$7$?8e$KD9$5$r?t$(!"=1B(B
=1B$B$=3D$l$,D9$$$H$-$K=1B(Brb_any_to_s()=1B$B$7$F$k$H$3$m$,=1B(B
=1B$B$"$j$^$9!#=1B(B

	    d =3D rb_protect(rb_inspect, obj, 0);
	    if (NIL_P(d) || RSTRING(d)->len > 65) {
		d =3D rb_any_to_s(obj);
	    }

=1B$B$3$l$r=1B(B
	    d =3D rb_any_to_s(obj);

=1B$B$H$7$F$$$?$@$1$^$;$s$+!"$H$$$&Ds0F$G$9!#=1B(B

Marshal.dump=1B$B$N$[$&$O!"=1B(B

    rb_define_method(rb_cNameErrorMesg, "_dump", name_err_mesg_to_str, =
1);

=1B$B$,4X78$"$k$N$+$J$"$HA[A|$7$F$^$9!#=1B(B


/* :nodoc: */
static VALUE
name_err_mesg_to_str(obj)
    VALUE obj;
{
    VALUE *ptr, mesg;
    Data_Get_Struct(obj, VALUE, ptr);

    mesg =3D ptr[0];
    if (NIL_P(mesg)) return Qnil;
    else {
	const char *desc =3D 0;
	VALUE d =3D 0, args[3];

	obj =3D ptr[1];
	switch (TYPE(obj)) {
	  case T_NIL:
	    desc =3D "nil";
	    break;
	  case T_TRUE:
	    desc =3D "true";
	    break;
	  case T_FALSE:
	    desc =3D "false";
	    break;
	  default:
	    d =3D rb_protect(rb_inspect, obj, 0);
	    if (NIL_P(d) || RSTRING(d)->len > 65) {
		d =3D rb_any_to_s(obj);
	    }
	    desc =3D RSTRING(d)->ptr;
	    break;
	}
	if (desc && desc[0] !=3D '#') {
	    d =3D rb_str_new2(desc);
	    rb_str_cat2(d, ":");
	    rb_str_cat2(d, rb_obj_classname(obj));
	}
	args[0] =3D mesg;
	args[1] =3D ptr[2];
	args[2] =3D d;
	mesg =3D rb_f_sprintf(3, args);
    }
    if (OBJ_TAINTED(obj)) OBJ_TAINT(mesg);
    return mesg;
}


In This Thread