[#36672] [Bug #616] instance_eval and Module#to_s — Shyouhei Urabe <redmine@...>

Bug #616: instance_eval and Module#to_s

12 messages 2008/10/06

[#36750] [Bug #650] Marshal.load raises RegexpError — Shyouhei Urabe <redmine@...>

Bug #650: Marshal.load raises RegexpError

30 messages 2008/10/15
[#36769] Re: [Bug #650] Marshal.load raises RegexpError — Yukihiro Matsumoto <matz@...> 2008/10/17

まつもと ゆきひろです

[#36771] Re: [Bug #650] Marshal.load raises RegexpError — Urabe Shyouhei <shyouhei@...> 2008/10/17

卜部です。

[#36772] Re: [Bug #650] Marshal.load raises RegexpError — Yukihiro Matsumoto <matz@...> 2008/10/17

まつもと ゆきひろです

[#36773] Re: [Bug #650] Marshal.load raises RegexpError — Urabe Shyouhei <shyouhei@...> 2008/10/17

卜部です。

[#36784] Re: [Bug #650] Marshal.load raises RegexpError — Yukihiro Matsumoto <matz@...> 2008/10/18

まつもと ゆきひろです

[#36785] Re: [Bug #650] Marshal.load raises RegexpError — Urabe Shyouhei <shyouhei@...> 2008/10/18

卜部です。

[#36793] Re: [Bug #650] Marshal.load raises RegexpError — Yukihiro Matsumoto <matz@...> 2008/10/19

まつもと ゆきひろです

[#36794] Re: [Bug #650] Marshal.load raises RegexpError — Urabe Shyouhei <shyouhei@...> 2008/10/19

Yukihiro Matsumoto さんは書きました:

[#36823] Re: [Bug #650] Marshal.load raises RegexpError — Yukihiro Matsumoto <matz@...> 2008/10/21

まつもと ゆきひろです

[#36830] Re: [Bug #650] Marshal.load raises RegexpError — Urabe Shyouhei <shyouhei@...> 2008/10/21

もとの正規表現にバグがあるのは認めますが、それに巻き込まれてでかいPStore

[#36833] Re: [Bug #650] Marshal.load raises RegexpError — Yukihiro Matsumoto <matz@...> 2008/10/21

まつもと ゆきひろです

[#36764] Re: [ruby-cvs:27036] Ruby:r19818 (trunk): * transcode.c (str_transcode0): String#encode without argument now — Martin Duerst <duerst@...>

まつもとさん、こんばんは。

11 messages 2008/10/17
[#36767] Re: [ruby-cvs:27036] Ruby:r19818 (trunk): * transcode.c (str_transcode0): String#encode without argument now — Yukihiro Matsumoto <matz@...> 2008/10/17

まつもと ゆきひろです

[#36799] Re: [ruby-cvs:27036] Ruby:r19818 (trunk): * transcode.c (str_transcode0): String#encode without argument now — Martin Duerst <duerst@...> 2008/10/20

まつもとさん、こんにちは。

[#36774] ConverterNotFoundError while making Ruby in Windows(trunk) — Masaki Suketa <masaki.suketa@...>

助田です。

13 messages 2008/10/17
[#36797] Re: ConverterNotFoundError while making Ruby in Windows(trunk) — "U.Nakamura" <usa@...> 2008/10/20

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

[#36800] Re: ConverterNotFoundError while making Ruby in Windows(trunk) — "U.Nakamura" <usa@...> 2008/10/20

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

[#36789] [Bug #660] 数字を3桁ずつコンマで区切るsprintf書式指定 — "rubikitch ." <redmine@...>

Bug #660: 数字を3桁ずつコンマで区切るsprintf書式指定

13 messages 2008/10/19

[#37007] [Bug:1.9] 1+1+1+...+1 dumps core — "Yusuke ENDOH" <mame@...>

遠藤です。

13 messages 2008/10/31

[ruby-dev:36898] Re: * lib/csv.rb: Failure test_inspect_is_ascii_8bit_encoded(TestCSVRow)

From: Kazuhiro NISHIYAMA <zn@...>
Date: 2008-10-24 05:26:04 UTC
List: ruby-dev #36898
西山和広です。

At Fri, 24 Oct 2008 13:42:54 +0900,
TAKANO Mitsuhiro wrote:
> 
> ----
> 1) Failure:
> test_inspect_is_ascii_8bit_encoded(TestCSVRow)
> [/home/takano/ruby/test/csv/test_
> row.rb:300]:
> <"ASCII-8BIT"> expected but was
> <"US-ASCII">.
> ----
> 
> についてのパッチです。
> 
> # ほんとにこんなんでいいのかな・・・
> # 文字コード周りに詳しい方教えてくださいっ。m(_ _)m

test/ruby/test_array.rbと一緒に実行すると再現すrようで、$,=""と

>> ("".encode("US-ASCII")+"".encode("ASCII-8BIT")).encoding
=> #<Encoding:US-ASCII>
>> ("".encode("ASCII-8BIT")+"".encode("US-ASCII")).encoding
=> #<Encoding:ASCII-8BIT>

が原因のように思いました。


> Index: lib/csv.rb
> ===================================================================
> --- lib/csv.rb  (revision 19903)
> +++ lib/csv.rb  (working copy)
> @@ -495,7 +495,7 @@
>                 ":" << field.inspect
>        end
>        str << ">"
> -      str.map { |s| s.encode("ASCII-8BIT") }.join
> +      str.map { |s| s.encode("ASCII-8BIT") }.join.encode("ASCII-8BIT")
>      end
>    end

グローバルな環境を変更して戻してないテストが悪い部分と
無引数のjoinを使っているところの両方を直すならこんな
感じでしょうか。

Index: lib/csv.rb
===================================================================
--- lib/csv.rb	(revision 19903)
+++ lib/csv.rb	(working copy)
@@ -495,7 +495,7 @@
                ":" << field.inspect
       end
       str << ">"
-      str.map { |s| s.encode("ASCII-8BIT") }.join
+      str.map { |s| s.encode("ASCII-8BIT") }.join("".encode("ASCII-8BIT"))
     end
   end
   
Index: test/ruby/test_array.rb
===================================================================
--- test/ruby/test_array.rb	(revision 19903)
+++ test/ruby/test_array.rb	(working copy)
@@ -814,6 +814,8 @@
     s = a.join
     assert_equal(true, s.tainted?)
     assert_equal(true, s.untrusted?)
+  ensure
+    $, = nil
   end
 
   def test_last
Index: test/ruby/test_hash.rb
===================================================================
--- test/ruby/test_hash.rb	(revision 19903)
+++ test/ruby/test_hash.rb	(working copy)
@@ -627,6 +627,7 @@
     assert_equal(h.inspect, h.to_s)
     h = @cls[]
     assert_equal(h.inspect, h.to_s)
+  ensure
     $, = nil
   end
 


-- 
|ZnZ(ゼット エヌ ゼット)
|西山和広(Kazuhiro NISHIYAMA)

In This Thread