Skip Menu |

This queue is for tickets about the Lingua-Translate CPAN distribution.

Report information
The Basics
Id: 36076
Status: open
Priority: 0/
Queue: Lingua-Translate

People
Owner: Nobody in particular
Requestors: gstead [...] ieee.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.08
Fixed in: (no value)



Subject: Module stopped working because URL moved?
Hello, I am a happy Lingua::Translate user. However, I have experienced failures recently and believe the URL may have moved? If I enter http://babelfish.altavista.com/tr? into my browser I am redirected to http://babelfish.yahoo.com/?fr=avbbf-xxen, with the message: "Welcome to Yahoo! Babel Fish! Please note you have been redirected from babelfish.altavista.com." To reproduce this error, simply install the module: perl Makefile.PL make make test PERL_DL_NONLAZY=1 /usr/bin/perl5.8.8 "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/01-babelfish....ok 1/4Request timed out more than 2 times (Request 1:301 Moved Permanently; Request 2:301 Moved Permanently; Request 3:301 Moved Permanently; ) at /root/.cpan/build/Lingua-Translate-0.08-1qyYrR/blib/lib/Lingua/Translate/Babelfish.pm line 206. # Looks like you planned 4 tests but only ran 2. # Looks like your test died just after 2. t/01-babelfish....dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 3-4 Failed 2/4 tests, 50.00% okay t/02-translate....ok 1/6Translation back-end failed; Request timed out more than 2 times (Request 1:301 Moved Permanently; Request 2:301 Moved Permanently; Request 3:301 Moved Permanently; ) at /root/.cpan/build/Lingua-Translate-0.08-1qyYrR/blib/lib/Lingua/Translate/Babelfish.pm line 206. # Looks like you planned 6 tests but only ran 2. # Looks like your test died just after 2. t/02-translate....dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 3-6 Failed 4/6 tests, 33.33% okay t/03-systran......ok Failed Test Stat Wstat Total Fail List of Failed ------------------------------------------------------------------------------- t/01-babelfish.t 255 65280 4 4 3-4 t/02-translate.t 255 65280 6 8 3-6 Failed 2/3 test scripts. 6/13 subtests failed. Files=3, Tests=13, 1 wallclock secs ( 0.66 cusr + 0.11 csys = 0.77 CPU) Failed 2/3 test programs. 6/13 subtests failed. make: *** [test_dynamic] Error 255 I will have someone look at it further but wondered if you can confirm and/or there is a trivial fix? best regards, -Graham
Subject: Re: [rt.cpan.org #36076] Module stopped working because URL moved?
Date: Thu, 22 May 2008 08:16:13 +1200
To: bug-Lingua-Translate [...] rt.cpan.org
From: Sam Vilain <sam [...] vilain.net>
Thanks for the report - if you can provide a patch to work with the new URL, I will happily incorporate it and release a new version of the module. Cheers, Sam. Graham Stead via RT wrote: Show quoted text
> Wed May 21 11:10:50 2008: Request 36076 was acted upon. > Transaction: Ticket created by gstead > Queue: Lingua-Translate > Subject: Module stopped working because URL moved? > Broken in: 0.08 > Severity: Critical > Owner: Nobody > Requestors: gstead@ieee.org > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=36076 > > > > Hello, > > I am a happy Lingua::Translate user. However, I have experienced > failures recently and believe the URL may have moved? > > If I enter http://babelfish.altavista.com/tr? into my browser I am > redirected to http://babelfish.yahoo.com/?fr=avbbf-xxen, with the > message: "Welcome to Yahoo! Babel Fish! Please note you have been > redirected from babelfish.altavista.com." > > To reproduce this error, simply install the module: > > perl Makefile.PL > make > make test > > PERL_DL_NONLAZY=1 /usr/bin/perl5.8.8 "-MExtUtils::Command::MM" "-e" > "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t > t/01-babelfish....ok 1/4Request timed out more than 2 times (Request > 1:301 Moved Permanently; Request 2:301 Moved Permanently; Request 3:301 > Moved Permanently; ) at > /root/.cpan/build/Lingua-Translate-0.08-1qyYrR/blib/lib/Lingua/Translate/Babelfish.pm > line 206. > # Looks like you planned 4 tests but only ran 2. > # Looks like your test died just after 2. > t/01-babelfish....dubious > Test returned status 255 (wstat 65280, 0xff00) > DIED. FAILED tests 3-4 > Failed 2/4 tests, 50.00% okay > t/02-translate....ok 1/6Translation back-end failed; Request timed out > more than 2 times (Request 1:301 Moved Permanently; Request 2:301 Moved > Permanently; Request 3:301 Moved Permanently; ) at > /root/.cpan/build/Lingua-Translate-0.08-1qyYrR/blib/lib/Lingua/Translate/Babelfish.pm > line 206. > # Looks like you planned 6 tests but only ran 2. > # Looks like your test died just after 2. > t/02-translate....dubious > Test returned status 255 (wstat 65280, 0xff00) > DIED. FAILED tests 3-6 > Failed 4/6 tests, 33.33% okay > t/03-systran......ok > Failed Test Stat Wstat Total Fail List of Failed > ------------------------------------------------------------------------------- > t/01-babelfish.t 255 65280 4 4 3-4 > t/02-translate.t 255 65280 6 8 3-6 > Failed 2/3 test scripts. 6/13 subtests failed. > Files=3, Tests=13, 1 wallclock secs ( 0.66 cusr + 0.11 csys = 0.77 CPU) > Failed 2/3 test programs. 6/13 subtests failed. > make: *** [test_dynamic] Error 255 > > I will have someone look at it further but wondered if you can confirm > and/or there is a trivial fix? > > best regards, > -Graham
Subject: Re: [rt.cpan.org #36076] Module stopped working because URL moved?
Date: Wed, 21 May 2008 21:56:51 -0700
To: bug-Lingua-Translate [...] rt.cpan.org
From: Graham Stead <gstead [...] ieee.org>
Hello Sam, I have attached a patch. This version passes unit tests and seems to translate again. I have not really made a patch before...please let me know it it's unusable (the diff seems correct but the path at the top of the file seems unique to my system). Let me know if I can do anything else. best regards, -Graham
--- /root/.cpan/build/Lingua-Translate-0.08-1qyYrR/lib/Lingua/Translate/Babelfish.pm 2005-04-01 08:42:00.000000000 -0800 +++ Lingua-Translate-0.08/lib/Lingua/Translate/Babelfish.pm 2008-05-21 10:08:27.000000000 -0700 @@ -36,7 +36,7 @@ ( backend => "Babelfish", babelfish_uri => - 'http://babelfish.altavista.com/tr?', + 'http://babelfish.yahoo.com/translate_txt', ua => LWP::UserAgent->new(), ); @@ -158,17 +158,17 @@ CHUNK: for my $chunk ( @chunks ) { - # make a new request object my $req = POST ($self->{babelfish_uri}, [ 'doit' => 'done', 'intl' => '1', - #'tt' => 'urltext', + 'tt' => 'urltext', 'trtext' => $chunk, 'lp' => join("_", @{$self}{qw(src dest)}), 'Submit' => 'Translate', - 'enc' => 'utf8', + 'ei' => 'UTF-8', + 'fr' => 'bf-res', ]); $req->header("Accept-Charset", "utf-8"); @@ -220,8 +220,8 @@ my($self, $html, $contenttype) = @_; my ($translated) = - ($html =~ m{<td \s bgcolor=white[^>]*> - (?:<div \s style=padding:10px;>)? + ($html =~ m{<div \s id="result[^>]*> + (?:<div \s style="padding:0.6em;">)? ([^<]*)</}xs) or die "Babelfish response unparsable, brain needed"; @@ -371,7 +371,7 @@ The uri to use when contacting Babelfish. The default value is -"http://babelfish.altavista.com/tr?" +"http://babelfish.yahoo.com/translate_txt?" =item agent
From: SAMV [...] cpan.org
On Thu May 22 00:57:52 2008, gstead wrote: Show quoted text
> Hello Sam, > > I have attached a patch. This version passes unit tests and seems to > translate again. > > I have not really made a patch before...please let me know it it's > unusable (the diff seems correct but the path at the top of the file > seems unique to my system). > > Let me know if I can do anything else.
No, that's fine, the patch looks good and I've rolled this into a new release on CPAN as 0.09. Thanks!