Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xlsx Chart Sheet Crash #235

Closed
Tim-Kracht opened this issue May 20, 2024 · 4 comments
Closed

Xlsx Chart Sheet Crash #235

Tim-Kracht opened this issue May 20, 2024 · 4 comments
Labels
bug Something isn't working 🗒️ calamine 🗒️ Calamine-related issue

Comments

@Tim-Kracht
Copy link

When loading a chart worksheet, load_sheet_by_name raises:

Exception has occurred: CalamineError
* 
calamine error: Xlsx error: Unexpected end of xml, expecting '</sheetData>'
Context:
    0: Error while loading sheet Chart1
  File "/Users/me/Source/test.py", line 17, in _get_worksheet_info
    ws = wb.load_sheet_by_name(name=sheet_name, header_row=header_row, schema_sample_rows=1)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_fastexcel.CalamineError: calamine error: Xlsx error: Unexpected end of xml, expecting '</sheetData>'
Context:
    0: Error while loading sheet Chart1

chart.xlsx

@lukapeschke lukapeschke added bug Something isn't working 🗒️ calamine 🗒️ Calamine-related issue labels May 22, 2024
@lukapeschke
Copy link
Collaborator

Hi @Tim-Kracht thanks for the bug report! Indeed, I can reproduce, but this appears to be an issue with calamine, as I also have the problem with the following rust code:

use calamine::{open_workbook, Reader, Xlsx};

fn main() {
    let mut workbook: Xlsx<_> = open_workbook("chart.xlsx").expect("could not open workbook");
    let range = workbook
        .worksheet_range("Chart1")
        .expect("could not open worksheet range");
}
thread 'main' panicked at examples/bug_235.rs:7:10:
could not open worksheet range: XmlEof("sheetData")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Could you please open an issue in the calamine repo so we can track progress here ? Thanks!

@Tim-Kracht
Copy link
Author

tafia/calamine#438

@tafia
Copy link

tafia commented Jul 8, 2024

Should be fixed now.

@PrettyWood
Copy link
Member

Solved upstream (see tafia/calamine#450). Thanks @tafia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🗒️ calamine 🗒️ Calamine-related issue
Projects
None yet
Development

No branches or pull requests

4 participants