Skip Menu |
 

This queue is for tickets about the XML-RSS CPAN distribution.

Report information
The Basics
Id: 7324
Status: resolved
Priority: 0/
Queue: XML-RSS

People
Owner: ABH [...] cpan.org
Requestors: rajit [...] yahoo-inc.com
Cc:
AdminCc:

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

Attachments


MIME-Version: 1.0
X-Mailer: MIME-tools 5.411 (Entity 5.404)
Subject: Can't ->parsefile; the .rss from http://www.t3.co.uk/rss/
Content-Type: multipart/mixed; boundary="----------=_1092240901-7913-0"
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 1624
Download (untitled) / with headers
text/plain 1.5k
XML-RSS-1.04, perl 5.6.1, FreeBSD 4.10 Using rss.pl as follows <<__END__; use XML::RSS; my $rss = new XML::RSS; $rss->parsefile("<downloaded .rss from http://www.t3.co.uk/rss/>"); __END__ Running this gives the error: Use of uninitialized value in string eq at /home/y/lib/perl5/site_perl/5.6.1/XML/RSS.pm line 1483. Use of uninitialized value in string eq at /home/y/lib/perl5/site_perl/5.6.1/XML/RSS.pm line 1348. Modification of non-creatable array value attempted, subscript -1 at /home/y/lib/perl5/site_perl/5.6.1/XML/RSS.pm line 1355. I've attached a patch that I created for RSS.pm that lets it parse the rss from t3.co.uk without a hitch. The problem seems to be '(!$ns && !$self->{rss_namespace})'. I made it just '!$ns' in all situations because I don't understand why we would expect $self->{rss_namespace} not to be defined. If someone is using rss as their default namespace, then that element _will_ be defined as per line 1456, but we might be inside an 'item' without a namespace since xmlns= might be set to rss. Hmm... maybe it's meant to read (!$ns && $self->{rss_namespace}) ?? I guess ideally you want to set $self->{default_namespace} then you could do (!$ns && $self->{default_namespace} eq 'rss') or something along those lines. Maybe the intention was to cater for not having rss defined by some lazy rss generator, in which case the following clause might work: !$self->{default_namespace} || (!$ns && $self->{default_namespace} eq 'rss') || ... Would much appreciate it if I could find out when the package has either been updated with the patch, or with a more appropriate fix. Cheers!
Content-Type: application/octet-stream; name="RSS.pm.diff"
Content-Disposition: inline; filename="RSS.pm.diff"
Content-Transfer-Encoding: base64
Content-Length: 1759
Download RSS.pm.diff
text/x-diff 1.7k
--- RSS.pm Wed Aug 11 16:41:07 2004 +++ /home/y/lib/perl5/site_perl/5.6.1/XML/RSS.pm Wed Aug 11 16:56:14 2004 @@ -1320,7 +1320,7 @@ my $ns = $self->namespace($self->current_element); # If it's in the default namespace if ( - (!$ns && !$self->{rss_namespace}) || + !$ns || ($ns eq $self->{rss_namespace}) ) { $self->{'image'}->{$self->current_element} .= $cdata; @@ -1346,7 +1346,7 @@ # If it's in the default RSS 1.0 namespace if ( - (!$ns && !$self->{rss_namespace}) || + !$ns || ($ns eq $self->{rss_namespace}) ) { $self->{'items'}->[$self->{num_items}-1]->{$self->current_element} .= $cdata; @@ -1368,7 +1368,7 @@ # If it's in the default namespace if ( - (!$ns && !$self->{rss_namespace}) || + !$ns || ($ns eq $self->{rss_namespace}) ) { $self->{'textinput'}->{$self->current_element} .= $cdata; @@ -1406,7 +1406,7 @@ # If it's in the default namespace if ( - (!$ns && !$self->{rss_namespace}) || + !$ns || ($ns eq $self->{rss_namespace}) ) { $self->{'channel'}->{$self->current_element} .= $cdata; @@ -1481,7 +1481,7 @@ my $ns = $self->namespace( $el ); if ( - (!$ns && !$self->{rss_namespace}) || + !$ns || ($ns eq $self->{rss_namespace}) ) { # increment item count
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.5.HEAD-6323-1142121574-1036.7324-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 342
Download (untitled) / with headers
text/plain 342b
On Wed Aug 11 12:15:02 2004, guest wrote: Show quoted text
> XML-RSS-1.04, perl 5.6.1, FreeBSD 4.10 > > Using rss.pl as follows <<__END__; > use XML::RSS; > my $rss = new XML::RSS; > $rss->parsefile("<downloaded .rss from http://www.t3.co.uk/rss/>");
Hi Rajit, Any chance you can create a test case for this we can include in the distribution? :-) - ask
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-326-1161342128-1984.7324-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: SHLOMIF [...] cpan.org
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 2177
Download (untitled) / with headers
text/plain 2.1k
On Wed Aug 11 12:15:02 2004, guest wrote: Show quoted text
> XML-RSS-1.04, perl 5.6.1, FreeBSD 4.10 > > Using rss.pl as follows <<__END__; > use XML::RSS; > my $rss = new XML::RSS; > $rss->parsefile("<downloaded .rss from http://www.t3.co.uk/rss/>"); > __END__ > > Running this gives the error: > Use of uninitialized value in string eq at > /home/y/lib/perl5/site_perl/5.6.1/XML/RSS.pm line 1483. > Use of uninitialized value in string eq at > /home/y/lib/perl5/site_perl/5.6.1/XML/RSS.pm line 1348. > Modification of non-creatable array value attempted, subscript -1 at > /home/y/lib/perl5/site_perl/5.6.1/XML/RSS.pm line 1355. > > I've attached a patch that I created for RSS.pm that lets it parse
the Show quoted text
> rss from t3.co.uk without a hitch. The problem seems to be '(!
$ns Show quoted text
> && !$self->{rss_namespace})'. I made it just '!$ns' in all > situations because I don't understand why we would expect $self-
> >{rss_namespace} not to be defined. If someone is using rss as
> their default namespace, then that element _will_ be defined as
per Show quoted text
> line 1456, but we might be inside an 'item' without a namespace > since xmlns= might be set to rss. > > Hmm... maybe it's meant to read (!$ns && $self->{rss_namespace}) ??
I Show quoted text
> guess ideally you want to set $self->{default_namespace} then you > could do (!$ns && $self->{default_namespace} eq 'rss') or
something Show quoted text
> along those lines. Maybe the intention was to cater for not
having Show quoted text
> rss defined by some lazy rss generator, in which case the
following Show quoted text
> clause might work: > !$self->{default_namespace} || (!$ns && $self->{default_namespace}
eq Show quoted text
> 'rss') || ... > > Would much appreciate it if I could find out when the package has > either been updated with the patch, or with a more appropriate
fix. Show quoted text
>
Hi! I tried it on the current version of the RSS feed, and it works fine: <<<<<< $ perl -w -Mstrict -MXML::RSS -e 'my $rss=XML::RSS->new(); $rss->parsefile(shift(@ARGV))' www.t3.co.uk.rss Show quoted text
>>>>>>
I guess the RSS feed was changed. Do you have a different RSS feed that reproduces this problem (or can create one?). If not, I suggest closing this bug. Regards, Shlomi Fish
MIME-Version: 1.0
X-Spam-Status: No, hits=-15.0 required=8.0 tests=BAYES_00,DK_POLICY_SIGNSOME,DK_POLICY_TESTING,DK_SIGNED,DK_VERIFIED,DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_WHOIS,NO_REAL_NAME,USER_IN_DEF_WHITELIST
In-Reply-To: <rt-3.6.HEAD-326-1161342128-1984.7324-6-0 [...] rt.cpan.org>
X-Mailer: Microsoft Office Outlook 11
Received-SPF: neutral (x1.develooper.com: local policy)
Reply-To: <rajit [...] yahoo-inc.com>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: US-ASCII
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 689784D8281 for <bug-XML-RSS [...] rt.cpan.org>; Fri, 20 Oct 2006 07:25:01 -0400 (EDT)
Received: (qmail 28922 invoked by alias); 20 Oct 2006 11:25:01 -0000
Received: from rsmtp2.corp.ukl.yahoo.com (HELO rsmtp2.corp.ukl.yahoo.com) (217.12.15.82) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Fri, 20 Oct 2006 04:24:57 -0700
Received: from ONEHEARWORLDLX (wifi-postauth132.london.corp.yahoo.com [10.76.37.132]) (authenticated bits=0) by rsmtp2.corp.ukl.yahoo.com (8.13.6/8.13.6/y.rout) with ESMTP id k9KBNsHT001576 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for <bug-XML-RSS [...] rt.cpan.org>; Fri, 20 Oct 2006 11:23:55 GMT
Delivered-To: cpan-bug+xml-rss [...] diesel.bestpractical.com
Subject: RE: [rt.cpan.org #7324] Can't ->parsefile; the .rss from http://www.t3.co.uk/rss/
Domainkey-Signature: a=rsa-sha1; s=serpent; d=yahoo-inc.com; c=nofws; q=dns; h=reply-to:from:to:subject:date:message-id:mime-version: content-type:content-transfer-encoding:x-mailer:in-reply-to:x-mimeole:thread-index; b=CWV2UTr6VnPRwhMoiJPLC1+uIOsxCdeUEsOvwGWnRFDwCIlTeAtgWZACPhY/rLNv
Return-Path: <rajit [...] yahoo-inc.com>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: bug-XML-RSS [...] rt.cpan.org
Thread-Index: Acb0NzsveeNtUy62Tl6ygLNXndZHKgAAvZFg
Date: Fri, 20 Oct 2006 12:23:54 +0100
Message-Id: <004501c6f43a$3a2b8910$73ed4c0a [...] ds.corp.yahoo.com>
X-Mimeole: Produced By Microsoft MimeOLE V6.00.2900.2962
To: <bug-XML-RSS [...] rt.cpan.org>
Content-Transfer-Encoding: 7bit
From: <rajit [...] yahoo-inc.com>
X-RT-Original-Encoding: utf-8
RT-Message-ID: <rt-3.6.HEAD-309-1161343520-680.7324-0-0 [...] rt.cpan.org>
Content-Length: 2545
Download (untitled) / with headers
text/plain 2.4k
Unfortunately forgotten my login details - can anyone else close the bug? Rajit Show quoted text
-----Original Message----- From: Shlomi Fish via RT [mailto:bug-XML-RSS@rt.cpan.org] Sent: 20 October 2006 12:02 To: rajit@yahoo-inc.com Subject: [rt.cpan.org #7324] Can't ->parsefile; the .rss from http://www.t3.co.uk/rss/ <URL: http://rt.cpan.org/Ticket/Display.html?id=7324 > On Wed Aug 11 12:15:02 2004, guest wrote:
> XML-RSS-1.04, perl 5.6.1, FreeBSD 4.10 > > Using rss.pl as follows <<__END__; > use XML::RSS; > my $rss = new XML::RSS; > $rss->parsefile("<downloaded .rss from http://www.t3.co.uk/rss/>"); > __END__ > > Running this gives the error: > Use of uninitialized value in string eq at > /home/y/lib/perl5/site_perl/5.6.1/XML/RSS.pm line 1483. > Use of uninitialized value in string eq at > /home/y/lib/perl5/site_perl/5.6.1/XML/RSS.pm line 1348. > Modification of non-creatable array value attempted, subscript -1 at > /home/y/lib/perl5/site_perl/5.6.1/XML/RSS.pm line 1355. > > I've attached a patch that I created for RSS.pm that lets it parse
the
> rss from t3.co.uk without a hitch. The problem seems to be '(!
$ns
> && !$self->{rss_namespace})'. I made it just '!$ns' in all > situations because I don't understand why we would expect $self-
> >{rss_namespace} not to be defined. If someone is using rss as
> their default namespace, then that element _will_ be defined as
per
> line 1456, but we might be inside an 'item' without a namespace > since xmlns= might be set to rss. > > Hmm... maybe it's meant to read (!$ns && $self->{rss_namespace}) ??
I
> guess ideally you want to set $self->{default_namespace} then you > could do (!$ns && $self->{default_namespace} eq 'rss') or
something
> along those lines. Maybe the intention was to cater for not
having
> rss defined by some lazy rss generator, in which case the
following
> clause might work: > !$self->{default_namespace} || (!$ns && $self->{default_namespace}
eq
> 'rss') || ... > > Would much appreciate it if I could find out when the package has > either been updated with the patch, or with a more appropriate
fix.
>
Hi! I tried it on the current version of the RSS feed, and it works fine: <<<<<< $ perl -w -Mstrict -MXML::RSS -e 'my $rss=XML::RSS->new(); $rss->parsefile(shift(@ARGV))' www.t3.co.uk.rss
>>>>>>
I guess the RSS feed was changed. Do you have a different RSS feed that reproduces this problem (or can create one?). If not, I suggest closing this bug. Regards, Shlomi Fish


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.