Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Tue Dec 19, 2023 1:59 pm

Currently, on Python, on some errors (but strangely not all), spire.XLS will make the whole Python process crash without any possibilities for recovery. I can reproduce it easily by trying to save in a file that doesn’t exist:

Code: Select all
from spire.xls import Workbook

try:
    workbook = Workbook()
    workbook.LoadFromFile("/tmp/toto.xlsx")
    workbook.SaveToFile("/home/notarealuser/toto.pdf")
except (Exception, BaseException) as e:
    print("Caught exception: ", e)

print("Done")


I’ll get this error and the Python process crashed:
Code: Select all
Unhandled Exception: System.UnauthorizedAccessException: UnauthorizedAccess_IODenied_Path, /home/notarealuser
 ---> System.IO.IOException: Permission denied
   Exception_EndOfInnerExceptionStack
   at System.IO.FileSystem.CreateDirectory(String, UnixFileMode) + 0xf1
   at System.IO.Directory.CreateDirectory(String) + 0x32
   at Spire.Xls.Workbook.spra(String) + 0x70
   at Spire.Xls.Workbook.SaveToFile(String) + 0x1d
   at Spire.Xls.AOT.NLWorkbook.Workbook_SaveToFile(IntPtr, IntPtr) + 0x54
[1]    236602 IOT instruction (core dumped)  python


I’d expect to be able to catch the error in my Python code.

I have also seen this happen as a result of this error but only from time to time, without changing anything to my code resulting in random crashes:

Code: Select all
Unhandled Exception: System.ArgumentException: Argument_AddingDuplicate__, /app/SomeFont.ttf, /app/SomeFont.ttf
   at System.Collections.Hashtable.Insert(Object, Object, Boolean) + 0x38b
   at spropj.spra() + 0x1dd
   at Spire.Xls.AOT.NLWorkbook.Workbook_set_CustomFontFilePaths(IntPtr, IntPtr, Int32) + 0x74


Is there at least a way to catch this kind of error?

  • OS: Ubuntu 22.04
  • Python 3.9
  • Spire.XLS version 13.9.0

spirexls_spinergie
 
Posts: 5
Joined: Wed Nov 22, 2023 1:33 pm

Wed Dec 20, 2023 7:56 am

Hi,

Thank you for your inquiry.
I tested the code you provided and reproduced your first error. I have recorded your issue in our bug tracking system with the number "SPIREXLS-5053". Our Dev team will investigate and fix it in the future. If this issue is resolved, we will notify you as soon as possible. We deeply apologize for any inconvenience caused. Regarding your second error, please provide us with a complete code that can reproduce this error. Thank you in advance.

Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Thu Dec 21, 2023 9:41 am

Regarding the second issue, I don’t have a way to reproduce it reliably. It seems to happen randomly without any changes in the code: sometimes several times in a row, sometimes never. I’ll keep monitoring this and try to give more details when/if I have some. At this stage, I can only say that it seems related to my usage of workbook.CustomFontFilePaths and that the error contains two times the same font, but not always the same. Weirdly enough, I don’t pass the same font two times. And if I explicitly do, I don’t have the error.

spirexls_spinergie
 
Posts: 5
Joined: Wed Nov 22, 2023 1:33 pm

Fri Dec 22, 2023 1:52 am

Hi,

Thank you for your feedback.
If you have any relevant information in the future, please feel free to contact us.

Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Mon Jan 15, 2024 9:26 am

Hello,

Thank you for your patience.
We are pleased to inform you that we have released the latest version of Spire.XLS for Python: Version 13.12.6. This new version includes a fix for the issue SPIREXLS-5053, which you reported previously. Welcome to test it.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1651
Joined: Wed Apr 07, 2021 2:50 am

Mon Jan 15, 2024 10:01 am

I can confirm this problem is solved. Thanks!

spirexls_spinergie
 
Posts: 5
Joined: Wed Nov 22, 2023 1:33 pm

Tue Jan 16, 2024 1:55 am

Hello,

Glad to hear that the issue has been resolved.
If you encounter other issues related to our products in the future, please feel free to contact us.
Have a nice day.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1651
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.XLS

cron