Project

Profile

Help

Bug #5936

closed

Python script Cross platform exception handling

Added by O'Neil Delpratt about 1 year ago. Updated 12 months ago.

Status:
Closed
Priority:
Normal
Category:
Python API
Start date:
2023-03-23
Due date:
% Done:

100%

Estimated time:
Found in version:
12.1
Fixed in version:
12.2
Platforms:

Description

Reported by user here: https://saxonica.plan.io/boards/4/topics/9341

In SaxonC 12.1 to support python exception handling we switched to the throwing of PySaxonApiError to a RuntimeError on Windows only. This was a was a last minute workaround for compiler/linker issues on Windows.

This is not ideal for users with python scripts which are supported across different platforms

Actions #1

Updated by O'Neil Delpratt about 1 year ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 50

I have reverted the change of creating a RuntimeError on Windows. We no throw a PySaxonApiError for SaxonC exceptions across all platforms.

Actions #2

Updated by O'Neil Delpratt about 1 year ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100

Bug fixed in the CythonExceptionHandler.cpp file.

It is reported that building the wheel with gcc/clang works fine but msvc it gets things mangled in the generated cpp file for the python extension. The issue is with extern PyObject pysaxonapierror in the C++ cpp file. The fix is to add ā€œCā€ -> extern "C" PyObject pysaxonapierror

Actions #3

Updated by O'Neil Delpratt 12 months ago

  • Status changed from Resolved to Closed
  • Fixed in version set to 12.2

Bug fix applied in the SaxonC 12.2 maintenance release.

Please register to edit this issue

Also available in: Atom PDF