Skip Menu |

This queue is for tickets about the Spreadsheet-Read CPAN distribution.

Report information
The Basics
Id: 69575
Status: resolved
Priority: 0/
Queue: Spreadsheet-Read

People
Owner: Nobody in particular
Requestors: davidp [...] preshweb.co.uk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.31
Fixed in: 0.46



Subject: Parsing XLS dies calling Spreadsheet::XLSX::Workbook->Parse()
It's possible I'm doing something wrong, but I'm calling: my $ss = Spreadsheet::Read::ReadData( $spreadsheet->file_handle, parser => 'xlsx' ); I get: Can't locate object method "Parse" via package "Spreadsheet::XLSX::Workbook" (perhaps you forgot to load "Spreadsheet::XLSX::Workbook"?) at /usr/local/share/perl/5.10.0/Spreadsheet/Read.pm line 369. I've installed Spreadsheet::XLSX: [davidp@shakermaker:~]$ ~/cpanm Spreadsheet::XLSX Spreadsheet::XLSX is up to date. (0.13) However, the Spreadsheet:XLSX::Workbook module that Spreadsheet::Read is trying to use is nowhere to be found: [davidp@shakermaker:~]$ perl -MSpreadsheet::XLSX::Workbook Can't locate Spreadsheet/XLSX/Workbook.pm in [...] Am I missing something else that should be installed, or is Spreadsheet::Read trying to use a module that's no longer on CPAN or something?
Subject: Re: [rt.cpan.org #69575] Parsing XLS dies calling Spreadsheet::XLSX::Workbook->Parse()
Date: Tue, 2 Aug 2011 10:55:45 +0200
To: bug-Spreadsheet-Read [...] rt.cpan.org
From: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
On Tue, 19 Jul 2011 08:39:15 -0400, "David Precious via RT" <bug-Spreadsheet-Read@rt.cpan.org> wrote: Show quoted text
> It's possible I'm doing something wrong, but I'm calling:
No, you are not Show quoted text
> my $ss = Spreadsheet::Read::ReadData ( > $spreadsheet->file_handle, parser => "xlsx" > );
The code in Spreadsheet::Read to parse XLSX as streams (from a handle, like you do) is just stub code. Spreadsheet::XLSX does not (yet) support parsing streams, so I just copied the code from Spreadsheet::ParseExcel, hoping the next version of Spreadsheet::XLSX supports it the same way. There is - at the moment - nothing I can do right now to fix this. -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using 5.00307 through 5.14 and porting perl5.15.x on HP-UX 10.20, 11.00, 11.11, 11.23 and 11.31, OpenSuSE 10.1, 11.0 .. 11.4 and AIX 5.2 and 5.3. http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
Subject: Re: [rt.cpan.org #69575] Parsing XLS dies calling Spreadsheet::XLSX::Workbook->Parse()
Date: Tue, 2 Aug 2011 10:01:04 +0100
To: bug-Spreadsheet-Read [...] rt.cpan.org
From: David Precious <davidp [...] preshweb.co.uk>
On Tuesday 02 August 2011 09:55:58 h.m.brand@xs4all.nl via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=69575 > > > On Tue, 19 Jul 2011 08:39:15 -0400, "David Precious via RT" > > <bug-Spreadsheet-Read@rt.cpan.org> wrote:
> > It's possible I'm doing something wrong, but I'm calling:
> No, you are not >
> > my $ss = Spreadsheet::Read::ReadData ( > > > > $spreadsheet->file_handle, parser => "xlsx" > > );
> > The code in Spreadsheet::Read to parse XLSX as streams (from a handle, > like you do) is just stub code. Spreadsheet::XLSX does not (yet) > support parsing streams, so I just copied the code from > Spreadsheet::ParseExcel, hoping the next version of Spreadsheet::XLSX > supports it the same way. There is - at the moment - nothing I can do > right now to fix this.
Ahhh - good to see it's not just me being silly, then :) It would probably be nice to note this in the Spreadsheet::Read documentation, to help avoid other people stumbling over this, and/or have attempts to do this result in Spreadsheet::Read dying with an informative error. It occurs to me that a somewhat bodgy solution would be for Spreadsheet::Read to work round the issue by reading data from the filehandle into a temporary file (using File::Temp), and give that file to Spreadsheet::XLSX, so that it all appears to work as expected. Would you be willing to consider this approach if I provided a patch, or do you consider it too hackish? Cheers Dave P
Subject: Re: [rt.cpan.org #69575] Parsing XLS dies calling Spreadsheet::XLSX::Workbook->Parse()
Date: Tue, 2 Aug 2011 11:21:14 +0200
To: bug-Spreadsheet-Read [...] rt.cpan.org
From: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
On Tue, 2 Aug 2011 05:01:16 -0400, "David Precious via RT" <bug-Spreadsheet-Read@rt.cpan.org> wrote: Show quoted text
> Ahhh - good to see it's not just me being silly, then :) > > It would probably be nice to note this in the Spreadsheet::Read documentation, > to help avoid other people stumbling over this, and/or have attempts to do > this result in Spreadsheet::Read dying with an informative error.
True Show quoted text
> It occurs to me that a somewhat bodgy solution would be for Spreadsheet::Read > to work round the issue by reading data from the filehandle into a temporary > file (using File::Temp), and give that file to Spreadsheet::XLSX, so that it > all appears to work as expected. Would you be willing to consider this > approach if I provided a patch, or do you consider it too hackish?
Not at this moment, as I know that someone (I know who, but I rather don't tell) is currently contemplating in making a GOOD XLSX parser, so I rather use that new version then fix up this broken version. For now, the end-user (you) can do the workaround by using a temp file. -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using 5.00307 through 5.14 and porting perl5.15.x on HP-UX 10.20, 11.00, 11.11, 11.23 and 11.31, OpenSuSE 10.1, 11.0 .. 11.4 and AIX 5.2 and 5.3. http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
From: psychedelys [...] googlemail.com
Hi, Show quoted text
> > It occurs to me that a somewhat bodgy solution would be for
> Spreadsheet::Read
> > to work round the issue by reading data from the filehandle into a
> temporary
> > file (using File::Temp), and give that file to Spreadsheet::XLSX, so
> that it
> > all appears to work as expected. Would you be willing to consider
> this
> > approach if I provided a patch, or do you consider it too hackish?
> > Not at this moment, as I know that someone (I know who, but I rather > don't tell) is currently contemplating in making a GOOD XLSX parser, > so I rather use that new version then fix up this broken version. > > For now, the end-user (you) can do the workaround by using a temp > file. >
Well with version 0.13 at least of Spreadsheet::XLSX this is working (at least for me) with the following patch: --- Read_old.pm 2010-05-21 17:11:42.000000000 +0200 +++ Read.pm 2011-09-20 09:46:22.000000000 +0200 @@ -367,7 +367,7 @@ $debug and print STDERR "Opening $parse_type \$txt\n"; if ($io_ref) { $oBook = $parse_type eq "XLSX" - ? Spreadsheet::XLSX::Workbook->Parse ($io_ref) + ? Spreadsheet::XLSX->new ($io_ref) : Spreadsheet::ParseExcel::Workbook->Parse ($io_ref); } else { Cheers, psychedelys
Subject: Re: [rt.cpan.org #69575] Parsing XLS dies calling Spreadsheet::XLSX::Workbook->Parse()
Date: Tue, 20 Sep 2011 16:02:28 +0200
To: bug-Spreadsheet-Read [...] rt.cpan.org
From: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
On Tue, 20 Sep 2011 08:33:06 -0400, "psychedelys via RT" <bug-Spreadsheet-Read@rt.cpan.org> wrote: Show quoted text
> Queue: Spreadsheet-Read > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=69575 > > > Hi, > >
> > > It occurs to me that a somewhat bodgy solution would be for
> > Spreadsheet::Read
> > > to work round the issue by reading data from the filehandle into a
> > temporary
> > > file (using File::Temp), and give that file to Spreadsheet::XLSX, so
> > that it
> > > all appears to work as expected. Would you be willing to consider
> > this
> > > approach if I provided a patch, or do you consider it too hackish?
> > > > Not at this moment, as I know that someone (I know who, but I rather > > don't tell) is currently contemplating in making a GOOD XLSX parser, > > so I rather use that new version then fix up this broken version. > > > > For now, the end-user (you) can do the workaround by using a temp > > file. > >
> Well with version 0.13 at least of Spreadsheet::XLSX this is working (at > least for me) with the following patch: > > --- Read_old.pm 2010-05-21 17:11:42.000000000 +0200 > +++ Read.pm 2011-09-20 09:46:22.000000000 +0200 > @@ -367,7 +367,7 @@ > $debug and print STDERR "Opening $parse_type \$txt\n"; > if ($io_ref) { > $oBook = $parse_type eq "XLSX" > - ? Spreadsheet::XLSX::Workbook->Parse ($io_ref) > + ? Spreadsheet::XLSX->new ($io_ref) > : Spreadsheet::ParseExcel::Workbook->Parse ($io_ref); > } > else {
Funny :) That is exactly what I have currently open as uncommitted change, as I have been unable to verify. Could you create me a test case please? -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using 5.00307 through 5.14 and porting perl5.15.x on HP-UX 10.20, 11.00, 11.11, 11.23 and 11.31, OpenSuSE 10.1, 11.0 .. 11.4 and AIX 5.2 and 5.3. http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/