https://bugs.documentfoundation.org/show_bug.cgi?id=163341

            Bug ID: 163341
           Summary: Zip64 ODS sheet not opening
           Product: LibreOffice
           Version: 24.8.2.1 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: framework
          Assignee: [email protected]
          Reporter: [email protected]

Description:
If I make an ODS spreadsheet using the Python package stream_write_ods
https://github.com/uktrade/stream-write-ods, but using its (new)
use_zip_64=True flag, then LibreOffice reports the file as corrupt.

This is in spite of the file validating as valid ODF at
https://odfvalidator.org/, and validating as a valid ZIP file using `unzip -t`.

Passing use_zip_64=False into stream_write_ods results in a file that opens in
LibreOffice without error.

Full disclosure: I am a maintainer of stream_write_ods, as well as its
underlying zip library. Of course, there _could_ be a problem at the ZIP level
(ZIPs are not easy!), but so far I've not found it

Steps to Reproduce:
1. Install Python (e.g. Python 3.11)

2. Install the latest version of stream-write-ods

pip install stream-write-ods==0.0.25

3. Create a Zip64 ODS file using the following Python script:

from stream_write_ods import stream_write_ods

ods_chunks = stream_write_ods((
    (
        'Sheet 1 name', ('col_1_name', 'col_2_name'), (
            ('Value A', 'Value B'),
            ('Value C', 'Value D'),
        )
    ),
), use_zip_64=True)

with open('test.ods', 'wb') as f:
    for chunk in ods_chunks:
        f.write(chunk)

4. Attempt to open the file in LibreOffice

Actual Results:
The following message appears:

----------------

The file 'test.ods' is corrupt and therefore cannot be opened. LibreOffice can
try to repair the file.

The corruption could be the result of document manipulation or of structural
document damage due to data transmission.

We recommend that you do not trust the content of the repaired document.
Execution of macros is disabled for this document.

Should LibreOffice repair the file?


Expected Results:
The files opens as a spreadsheet without error


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.8.2.1 (AARCH64) / LibreOffice Community
Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13
CPU threads: 8; OS: macOS 14.5; UI render: Skia/Raster; VCL: osx
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to