Skip Menu |
 

This queue is for tickets about the Yahoo-Search CPAN distribution.

Report information
The Basics
Id: 32011
Status: resolved
Priority: 0/
Queue: Yahoo-Search

People
Owner: Nobody in particular
Requestors: bernt.budde [...] gmail.com
Cc:
AdminCc:

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



Subject: Yahoo/Search/XML.pm
Date: Sun, 30 Dec 2007 19:36:50 +0100
To: bug-Yahoo-Search [...] rt.cpan.org
From: "Bernt Budde" <bernt.budde [...] gmail.com>
Download (untitled) / with headers
text/plain 891b
Hello! I am Bernt Budde from Uppsala, Sweden. In Yahoo/Search/XML.pm, I had to change the _entity sub because of a bug. (I was really using the Geo-Coder-Yahoo-0.03 distribution.) This is probably just another aspect of the already reported utf-8 problem. But I use a borrowed portable over Xmas, so... + $VERSION = "20060729.004" + Perl version = 5.8.6 + OS = Mac OS X, 10.4 PowerPC # It used $val instead of $name, despite knowing it was undef # from first test. :-) # Tagged my changes with '/Bug' below. sub _entity($) { my $name = shift; if (my $val = $EntityDecode{$name}) { return $val; } elsif ($name =~ m/^#(\d+)$/) { # val->name /Bug return chr($1); } elsif ($name =~ m/^#x([0-9a-f]+)$/i) { # /Bug return chr(hex($1)); # /Bug } else { _error(__LINE__, "unknown entity &$name;"); } }
Download (untitled) / with headers
text/plain 114b
Hi. I've taken over maintenance of Yahoo::Search (at least for now). Can you give me a test case for this problem?
Subject: Re: [rt.cpan.org #32011] Yahoo/Search/XML.pm
Date: Fri, 11 Jun 2010 13:50:56 +0000
To: Tim_Bunce via RT <bug-Yahoo-Search [...] rt.cpan.org>
From: bernt.budde [...] gmail.com
Download (untitled) / with headers
text/plain 853b
Hello! I don't think it matters any more. From the pod: =head1 EVIL HACKS In version 0.01 this module redefined the Yahoo::Search::XML::_entity function with a bug-fixed one. In Yahoo::Search 1.5.8 that function was fixed, so we don't do that anymore. =cut Wish I could help more, but I changed job two years ago and don't have neither code nor data. Or even memory of the exact problem; I wrote code all day for months, then (too). If you haven't seen any other similar complaints, write it off to a stupid programmer on a system/Perl he didn't install himself. :-) :-( /Bernt On Jun 11, 2010 3:11pm, Tim_Bunce via RT <bug-Yahoo-Search@rt.cpan.org> wrote: Show quoted text
Show quoted text
> Hi.
Show quoted text
> I've taken over maintenance of Yahoo::Search (at least for now).
Show quoted text
> Can you give me a test case for this problem?
Subject: Re: Re: [rt.cpan.org #32011] Yahoo/Search/XML.pm
Date: Fri, 11 Jun 2010 13:54:42 +0000
To: Tim_Bunce via RT <bug-Yahoo-Search [...] rt.cpan.org>
From: bernt.budde [...] gmail.com
Download (untitled) / with headers
text/plain 1.1k
Ah, the documentation quote from previous email was from the documentation of the Geo::Coder::Yahoo-documentation. That is, I MIGHT have sent the email to the wrong destination... /Bernt On Jun 11, 2010 4:50pm, bernt.budde@gmail.com wrote: Show quoted text
> Hello!
Show quoted text
> I don't think it matters any more. From the pod:
Show quoted text
> =head1 EVIL HACKS
Show quoted text
> In version 0.01 this module redefined the Yahoo::Search::XML::_entity > function with a bug-fixed one. In Yahoo::Search 1.5.8 that function > was fixed, so we don't do that anymore.
Show quoted text
> =cut
Show quoted text
> Wish I could help more, but I changed job two years ago and don't have > neither code nor data. Or even memory of the exact problem; I wrote code > all day for months, then (too).
Show quoted text
> If you haven't seen any other similar complaints, write it off to a > stupid programmer on a system/Perl he didn't install himself. :-) :-(
Show quoted text
> /Bernt
Show quoted text
> On Jun 11, 2010 3:11pm, Tim_Bunce via RT bug-Yahoo-Search@rt.cpan.org> > wrote:
> > https://rt.cpan.org/Ticket/Display.html?id=32011 > > > > > > > > > Hi. > > > > I've taken over maintenance of Yahoo::Search (at least for now). > > > > Can you give me a test case for this problem? > >
Subject: Re: Re: Re: [rt.cpan.org #32011] Yahoo/Search/XML.pm
Date: Fri, 11 Jun 2010 14:26:27 +0000
To: Tim_Bunce via RT <bug-Yahoo-Search [...] rt.cpan.org>
From: bernt.budde [...] gmail.com
Download (untitled) / with headers
text/plain 942b
Sorry for email-bombing you. :-) I'm not confused any more, I hope. I don't have tests/data, but the code is obvious. From the code, here: http://cpansearch.perl.org/src/JFRIEDL/Yahoo-Search-1.10.13/lib/Yahoo/Search/XML.pm =head1 BUDDE'S BUG DESCRIPTION I quoted the relevant code and data structure and added #1 and #2. The in parameter to _entity is C<$name>. At #1 it sets C<$val> from C<$EntityDecode{$name}>. At #2 the code tries to get a char code from C<$val>. But C<$val> is from C<%EntityDecode> (#1) and can't contain any char code. It obviously ought to use C<$name> instead. The fix I sent in on C<_entity()> I<should> work. my %EntityDecode = ( amp => '&', lt => '<', gt => '>', apos => "'", quot => '"', #" ); sub _entity($) { my $name = shift; if (my $val = $EntityDecode{$name}) { # 1 return $val; } elsif ($val =~ m/^#(\d+)$/) { #2 return chr($1); } else { _error(__LINE__, "unknown entity &$name;"); } } =cut
Subject: Re: Re: [rt.cpan.org #32011] Yahoo/Search/XML.pm
Date: Fri, 11 Jun 2010 16:45:24 +0100
To: Bernt Budde via RT <bug-Yahoo-Search [...] rt.cpan.org>
From: Tim Bunce <Tim.Bunce [...] pobox.com>
Download (untitled) / with headers
text/plain 733b
On Fri, Jun 11, 2010 at 09:54:53AM -0400, Bernt Budde via RT wrote: Show quoted text
> > Ah, the documentation quote from previous email was from the documentation > of the Geo::Coder::Yahoo-documentation. > > That is, I MIGHT have sent the email to the wrong destination...
I don't think so. The code of _entity was clearly broken. See my commit, based on your patch: http://github.com/timbunce/Yahoo-Search/commit/6f61e0e1788ac78a9ae601793f34d9d3fdeb88b4 So I don't understand the comment in Geo::Coder::Yahoo. I *suspect* that Yahoo is now sending simple utf8 chars instead of using entity notation (other than the required &,<,>," etc). That's why I'm curious if you can come up with a test case that still fails with the old code. Tim.
Subject: Re: Re: Re: [rt.cpan.org #32011] Yahoo/Search/XML.pm
Date: Fri, 11 Jun 2010 22:09:25 +0100
To: Bernt Budde via RT <bug-Yahoo-Search [...] rt.cpan.org>
From: Tim Bunce <Tim.Bunce [...] pobox.com>
Download (untitled) / with headers
text/plain 357b
On Fri, Jun 11, 2010 at 10:26:37AM -0400, Bernt Budde via RT wrote: Show quoted text
> > I don't have tests/data, but the code is obvious.
I know the code is obviousm that why I applied the patch up-front. But it's simply good practice to add a regression test where practical. I'll close the ticket now (no need to reply, it'll get reopened). Thanks for your help. Tim.
Patch applied. Thanks!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.