bugGNU Octave - Bugs: bug #62169, [octave forge](io) xlsread fails...

 
 

bug #62169: [octave forge](io) xlsread fails using UNO interface to process sheets with comma in name

Submitter:  None
Submitted:  Fri 11 Mar 2022 02:12:26 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  philipnienhuis
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * other
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 22 Mar 2022 09:03:47 PM UTC, comment #5: 

Thanks for reporting back.

I'll close this report as "fixed".
The other LibreOffice errors I mentioned in below comments had better be subject of another separate bug report.

Philip Nienhuis <philipnienhuis>
Group Member
Tue 22 Mar 2022 06:51:32 AM UTC, comment #4: 

(OP here) Thank you for the quick fixes!

comment #2:

> Working on this bug got me wondering why you didn't encounter it on "Linux (Ubuntu 20.04.4), Octave 6.4, encoding utf-8, neither io version 2.6.3 nor 2.6." - the code that had to be fixed was clearly wrong (as long as commas in sheet names are concerned).


I have no idea either, I just got the info when my colleague suddenly couldn't run the code on his Windows machine. But for the record:


>> ver
----------------------------------------------------------------------
GNU Octave Version: 6.3.1 (hg id: 3b6e0f476381)
GNU Octave License: GNU General Public License
Operating System: Linux 5.4.0-100-generic #113-Ubuntu SMP Thu Feb 3 18:43:29 UTC 2022 x86_64
----------------------------------------------------------------------
Package Name        | Version | Installation directory
--------------------+---------+-----------------------
           arduino  |   0.7.0 | /home/IT/jzimmer/octave/arduino-0.7.0
           control *|   3.3.1 | /home/IT/jzimmer/octave/control-3.3.1
          database *|   2.4.4 | /home/IT/jzimmer/octave/database-2.4.4
             image *|  2.12.0 | /home/IT/jzimmer/octave/image-2.12.0
instrument-control  |   0.7.0 | .../octave/instrument-control-0.7.0
                io *|   2.6.4 | /home/IT/jzimmer/octave/io-2.6.4
             optim *|   1.6.1 | /home/IT/jzimmer/octave/optim-1.6.1
            signal *|   1.4.1 | /home/IT/jzimmer/octave/signal-1.4.1
        statistics *|   1.4.2 | /home/IT/jzimmer/octave/statistics-1.4.2
            struct *|  1.0.17 | /home/IT/jzimmer/octave/struct-1.0.17
          symbolic *|   2.9.0 | /home/IT/jzimmer/octave/symbolic-2.9.0



comment #2:

> Please test the fixes: get

__UNO_spsh2oct__.m and __UNO_getusedrange__.m -nomarkup+ from the repo:
> http://hg.code.sf.net/p/octave/io/file/4673fea74b8e/inst/private/
> ...replace them with the ones in your Octave installation, try again, and report back.

That worked just fine! No warnings or errors.

Anonymous
Sun 20 Mar 2022 06:35:44 PM UTC, comment #3: 

I pushed another fix to allow reading sheets with just one occupied cell, here:
http://hg.code.sf.net/p/octave/io/rev/27df46051952

OK, tried at home, works fine there w/o any warnings or errors, with:

  • Windows 10
  • LibreOffice 7.0.1.2. (x64)


>> system ("java -version")
java version "15" 2020-09-15
Java(TM) SE Runtime Environment (build 15+36-1562)
Java HotSpot(TM) 64-Bit Server VM (build 15+36-1562, mixed mode, sharing)
ans = 0


I still have to find out why I get errors (in Windows 10) and warnings (on Linux) with newer LibreOffice and/or Java, but that's outside the scope of this bug report.
At issue is that the LibreOffice / OpenOffice.org Java-UNO subsystem has been written in an extremely convoluted way, quite beyond my capabilities as a non-Java programmer. So it may be a while until I get to it :-(

Philip Nienhuis <philipnienhuis>
Group Member
Sat 19 Mar 2022 05:31:07 PM UTC, comment #2: 

Fixing this bug became a bit complicated because LibreOffice seems to have changed its Java-UNO bridge so that on Linux I now get
"CE> IO error"
messages and on Windows loading spreadsheet files doesn't work at all anymore.  IOW I got quite a bit distracted along the way.
A provisional fix is pushed here:
http://hg.code.sf.net/p/octave/io/rev/4673fea74b8e

Working on this bug got me wondering why you didn't encounter it on "Linux (Ubuntu 20.04.4), Octave 6.4, encoding utf-8, neither io version 2.6.3 nor 2.6." - the code that had to be fixed was clearly wrong (as long as commas in sheet names are concerned).

Anyway, AFAICS on Linux this bug seems fixed. I have to wait until I get home (abroad now) before I can test on my Windows 10 desktop machine where older LibreOffice and Java releases are installed.

Please test the fixes: get

__UNO_spsh2oct__.m and __UNO_getusedrange__.m -nomarkup+ from the repo:
http://hg.code.sf.net/p/octave/io/file/4673fea74b8e/inst/private/
...replace them with the ones in your Octave installation, try again, and report back.
To find where the files reside, in Octave do:
cd (strrep (which ("xls2oct"), "xls2oct.m", "private"))

I still have to run a few other checks as regards this bug before this report can be closed.

Philip Nienhuis <philipnienhuis>
Group Member
Sat 12 Mar 2022 11:44:20 PM UTC, comment #1: 

Confirmed.

There are alternative workarounds:
Invoke the jOpenDocument support library (JOD); AFAIK that's the fastest Java-based .ods interface anyway so you might enjoy some better performance as well.
You can also try the native interface (OCT), but it is known to be quite slow.

(title adapted)

Philip Nienhuis <philipnienhuis>
Group Member
Fri 11 Mar 2022 02:12:26 PM UTC, original submission:  

Hi,

when I try to open an .ods table and specifically read a sheet whose name includes a comma, I get the following error:

error: [java] com.sun.star.lang.IndexOutOfBoundsException:
error: called from
    __UNO_spsh2oct__ at line 90 column 13
    xls2oct at line 215 column 30
    xlsread at line 384 column 32


The system in question is Octave 6.4 running on Windows 10, encoding utf-8, io package version 2.6.4. We're working around it by using ; or . as separators, that works just fine.

I also can't reproduce the error in Linux (Ubuntu 20.04.4), Octave 6.4, encoding utf-8, neither io version 2.6.3 nor 2.6.4; that works in any combination.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by philipnienhuis
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-03-22 philipnienhuis StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2022-03-21 philipnienhuis Carbon-Copy- Added philipnienhuis
    2022-03-19 philipnienhuis StatusConfirmed Ready For Test
    2022-03-12 philipnienhuis StatusNone Confirmed
        Assigned toNone philipnienhuis
        Release6.4.0 other
        Operating SystemMicrosoft Windows Any
        Summary(io) xlsread fails to process sheets with comma in name [octave forge](io) xlsread fails using UNO interface to process sheets with comma in name

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code