8000 BUG: `np.dtype("a")` NumPy 2 deprecation seems not properly tested and raising fails. · Issue #26521 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
BUG: np.dtype("a") NumPy 2 deprecation seems not properly tested and raising fails. #26521
Closed
@seberg

Description

@seberg

The following should either raise the DeprecationWarning properly, or life in the future and raise a TypeError, but it doesn't raise anything:

In [4]: warnings.simplefilter("error")
In [5]: np.dtype("a")
---------------------------------------------------------------------------
DeprecationWarning                        Traceback (most recent call last)
DeprecationWarning: Data type alias `a` was removed in NumPy 2.0. Use `S` alias instead.

The above exception was the direct cause of the following exception:

SystemError                               Traceback (most recent call last)
Cell In[5], line 1
----> 1 np.dtype("a")

SystemError: <class 'numpy.dtype'> returned a result with an exception set

Probably there is no test for it in test_deprecations.py (since those tests automatically try to cover the failure path).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0