Skip to content

Fix Numpy 1.20.0 by initializing PyArray_Descr portably

Description

According to the Numpy documentation:

To ensure compatibility:

  • Never declare a non-pointer instance of the struct
  • Never perform pointer arithmatic
  • Never use sizof(PyArray_Descr)

The SWIG bindings broke the first of these rules. Improper order of initialization led to a null pointer that was causing a segfault.

Fixes #414 (closed). (We shall see!)

API Changes and Justification

Backwards Compatible Changes

  • This change introduces no API changes
  • This change adds new API calls

Backwards Incompatible Changes

  • This change modifies an existing API
  • This change removes an existing API

If any of the Backwards Incompatible check boxes are ticked please provide a justification why this change is necessary and why it needs to be done in a backwards incompatible way.

Review Status

N/A

Edited by Karl Wette

Merge request reports