question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ENH: Use the semantic version instead of the C-API version in the error message for C-API incompatibility

See original GitHub issue

Proposed new feature or change:

In the module generate_numpy_api, which is inside the sub package numpy.core.code_generators , there is the generation of the C method static int _import_array(void), which has an if statement like the following:

if (NPY_FEATURE_VERSION > PyArray_GetNDArrayCFeatureVersion()) {
      PyErr_Format(PyExc_RuntimeError, "module compiled against "\
             "API version 0x%%x but this version of numpy is 0x%%x", \
             (int) NPY_FEATURE_VERSION, (int) PyArray_GetNDArrayCFeatureVersion());
      return -1;
  }

I would like to change this error message to, instead of telling about the C-API version, tell about the semantic version of the numpy package. The motivation is that the error seems obscure when using this hexadecimal version that seems to have no relation to the semantic version. Would it be welcome ?

If so, I can try a PR. However, how could I trigger this error for the matter of testing my solution ? Also, is there some way to get the semantic version from the C-API ? Or should I introduce a new macro for it ?

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
mattipcommented, Jul 6, 2022

We have the troubleshooting guide, the source is here. PRs are welcome. I think the date, the message, what two packages+versions caused the problem, and what version of NumPy provided a solution would be specific enough to be helpful.

0reactions
joaopfgcommented, Jul 8, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Semnatic version not extracted from jar filename when using CLI
Calling japcmp and generating the report works just fine, but I'm unable to use the --error-on-semantic-incompatibility flag. That's how it's integrated in ...
Read more >
Semantic Versioning 2.0.0 | Semantic Versioning
Given a version number MAJOR.MINOR.PATCH, increment the: MAJOR version when you make incompatible API changes; MINOR version when you add functionality in a ......
Read more >
Terraform AzureRM provider version history - Microsoft Learn
This article contains the following change logs from the HashiCorp site showing the Terraform AzureRM provider versions:.
Read more >
VMware Cloud on AWS Release Notes
Optional Release: VMware Cloud on AWS (SDDC Version 1.19) | 29 June 2022 ... To customers and partners: No need for upfront capital...
Read more >
TABLE OF CONTENTS CHAPTER 49-000 CASH ...
Eligibility for Cash Assistance Program for Immigrants (CAPI) . ... signed prior to the formulation and implementation of the new version of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found