WWW::Mechanize 1.24 は "do not use" release
要するにこれを見落としていただけなんですけれどね。昨日しばらくハマっていたのでここにもメモっておきます。
1.24 Fri May 11 15:57:56 CDT 2007 ======================================== NOTE: Version 1.24 will NOT automatically decode gzipped content for you any more. Consider it a "do not use" release.
それと、Mech 1.30。存在しないはずのサイトにアクセスしたときの動作をチェックするテストがあるんですが、これ、利用しているDNSによっては、そんなホストは知らないよというメッセージとともにステータスコード200のページ(広告てんこもり)が吐かれてしまうため、テストがこけます。
とりあえずうちではこんなパッチをあててごまかしましたが、localhostはlocalhostで別鯖が走っているからこけるという人も出そうなので、RTに投げるとしたらもう少し何か考えてからにする予定。
diff -ur WWW-Mechanize-1.30/t/autocheck.t WWW-Mechanize-1.30-patched/t/autocheck.t --- WWW-Mechanize-1.30/t/autocheck.t 2007-02-14 02:23:12.000000000 +0900 +++ WWW-Mechanize-1.30-patched/t/autocheck.t 2007-06-01 12:18:12.945250000 +0900 @@ -4,7 +4,7 @@ use strict; use Test::More; -use constant NONEXISTENT => 'http://blahblablah.xx-nonexistent.'; +use constant NONEXISTENT => 'http://localhost/blahblablah.xx-nonexistent'; BEGIN { eval 'use Test::Exception'; diff -ur WWW-Mechanize-1.30/t/local/failure.t WWW-Mechanize-1.30-patched/t/local/failure.t --- WWW-Mechanize-1.30/t/local/failure.t 2006-08-19 15:28:10.000000000 +0900 +++ WWW-Mechanize-1.30-patched/t/local/failure.t 2007-06-01 12:24:15.476500000 +0900 @@ -35,7 +35,8 @@ } BAD_PAGE: { - my $badurl = "http://blahblahblah.xx-only-testing."; + my $badurl = $server->url; + $server->stop; $mech->get( $badurl ); ok( !$mech->success, 'Failed the fetch' );
なんにせよ、無条件で1.30にあげればよいかというとそうも言えなくて、1.29_01からデコードの扱いが変更になっているせいでうかつにあげると思いもよらなかったところでスクリプトが壊れる可能性があるので、Mechを使っている方は要注意です。
1.30 Thu May 24 21:31:10 CDT 2007 ======================================== [DOCUMENTATION] *1180768582* Minor doc fixes. Thanks David Steinbrunner. 1.29_01 Tue May 22 14:02:55 CDT 2007 ======================================== Kevin Falcone and I ask for your assistance in figuring out how to handle the warnings thrown by the tests, other than hiding them. [FIXES] *1180768583* Overhauled how tainting was done. Stole code directly from Test::Taint. *1180768584* Have LWP only handle decoding of Content-Encoding, not charset. [DOCUMENTATION] *1180768585* Fixed the docs for $mech->submit_form()'s with_fields arg. Thanks, Peteris Krumins.