Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1270726

Bug#1120971: powerpc: _ctype_from_dtype_scalar NotImplementedError: Converting dtype('int32') to a ctypes type

From Drew Parsons <dparsons@debian.org>
Newsgroups linux.debian.bugs.dist, linux.debian.ports.powerpc
Subject Bug#1120971: powerpc: _ctype_from_dtype_scalar NotImplementedError: Converting dtype('int32') to a ctypes type
Date 2025-11-18 22:50 +0100
Message-ID <LSBKh-dYBl-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Cross-posted to 2 groups.

Show all headers | View raw


Source: numpy
Version: 1:2.3.4+ds-3
Severity: normal
X-Debbugs-Cc: debian-powerpc@lists.debian.org
User: debian-powerpc@lists.debian.org
Usertags: powerpc
Control: forwarded -1 https://github.com/numpy/numpy/issues/30257
Control: affects -1 src:fenics-dolfinx

Debian tests of dolfinx on powerpc have exposed an irregularity in ppc ctypes
https://buildd.debian.org/status/fetch.php?pkg=fenics-dolfinx&arch=powerpc&ver=1%3A0.10.0.post2-1exp2&stamp=1763496611&raw=0

/usr/lib/python3/dist-packages/numpy/ctypeslib.py:382: in _ctype_from_dtype_scalar
    raise NotImplementedError(
E   NotImplementedError: Converting dtype('int32') to a ctypes type

The failing line

numpy/numpy/ctypeslib/_ctypeslib.py

Line 385 in a251f2a
 ctype = _scalar_type_map[dtype_native] 

is simply trying to access a ctype for dtype int32.

The problem can be reproduced manually. The strange thing is that
inspecting the _scalar_type_map dict (on ppc), it clearly shows an
entry dtype('int32'): <class 'ctypes.c_long'>


import numpy as np
import platform
print("testing architecture", platform.machine())
a = np.array([1], dtype=np.int32)
dtype_native = a.dtype.newbyteorder('=')
print("'np.int32' is", dtype_native)
print("ctypeslib _scalar_type_map is", np.ctypeslib._scalar_type_map)
print(f"extract ctype for {dtype_native}:")
ctype = np.ctypeslib._scalar_type_map[dtype_native]
print("got ctype", ctype)

Back to linux.debian.bugs.dist | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Bug#1120971: powerpc: _ctype_from_dtype_scalar NotImplementedError: Converting dtype('int32') to a ctypes type Drew Parsons <dparsons@debian.org> - 2025-11-18 22:50 +0100
  Bug#1120971: powerpc: _ctype_from_dtype_scalar NotImplementedError: Converting dtype('int32') to a ctypes type Drew Parsons <dparsons@debian.org> - 2025-11-19 12:50 +0100

csiph-web