#1145499 openturns: FTBFS: /<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:4014:7: error: 'PyInt_Check' was not declared in this scope; did you mean 'PySet_Check'?

Package:
src:openturns
Source:
src:openturns
Submitter:
Santiago Vila
Date:
2026-09-01 20:39:02 UTC
Severity:
normal
Tags:
#1145499#5
Date:
2026-08-25 12:42:34 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202608/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:openturns, so that this is still
visible in the BTS web page for this package.

Thanks.
--------------------------------------------------------------------------------
[...]
[ 38%] Building CXX object python/src/CMakeFiles/typ.dir/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx.o
cd /<<PKGBUILDDIR>>/builddir/python/src && /usr/bin/x86_64-l [too-long-redacted] p.dir/typ_modulePYTHON_wrap.cxx
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx: In function ‘PyObject* OT_Description___setitem__(OT::Description*, PyObject*, PyObject*)’:
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:4014:7: error: ‘PyInt_Check’ was not declared in this scope; did you mean ‘PySet_Check’?
 4014 |   if (PyInt_Check(arg))
      |       ^~~~~~~~~~~
      |       PySet_Check
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:4088:18: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 4088 |     long index = PyInt_AsLong(intValue.get());
      |                  ^~~~~~~~~~~~
      |                  PyLong_AsLong
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx: In function ‘PyObject* OT_Description___getitem__(const OT::Description*, PyObject*)’:
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:4103:7: error: ‘PyInt_Check’ was not declared in this scope; did you mean ‘PySet_Check’?
 4103 |   if (PyInt_Check(arg))
      |       ^~~~~~~~~~~
      |       PySet_Check
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:4165:18: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 4165 |     long index = PyInt_AsLong(intValue.get());
      |                  ^~~~~~~~~~~~
      |                  PyLong_AsLong
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx: In function ‘PyObject* OT_Indices___setitem__(OT::Indices*, PyObject*, PyObject*)’:
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:4208:7: error: ‘PyInt_Check’ was not declared in this scope; did you mean ‘PySet_Check’?
 4208 |   if (PyInt_Check(arg))
      |       ^~~~~~~~~~~
      |       PySet_Check
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:4282:18: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 4282 |     long index = PyInt_AsLong(intValue.get());
      |                  ^~~~~~~~~~~~
      |                  PyLong_AsLong
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx: In function ‘PyObject* OT_Indices___getitem__(const OT::Indices*, PyObject*)’:
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:4297:7: error: ‘PyInt_Check’ was not declared in this scope; did you mean ‘PySet_Check’?
 4297 |   if (PyInt_Check(arg))
      |       ^~~~~~~~~~~
      |       PySet_Check
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:4359:18: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 4359 |     long index = PyInt_AsLong(intValue.get());
      |                  ^~~~~~~~~~~~
      |                  PyLong_AsLong
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx: In function ‘PyObject* OT_Point___setitem__(OT::Point*, PyObject*, PyObject*)’:
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:4476:7: error: ‘PyInt_Check’ was not declared in this scope; did you mean ‘PySet_Check’?
 4476 |   if (PyInt_Check(arg))
      |       ^~~~~~~~~~~
      |       PySet_Check
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:4550:18: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 4550 |     long index = PyInt_AsLong(intValue.get());
      |                  ^~~~~~~~~~~~
      |                  PyLong_AsLong
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx: In function ‘PyObject* OT_Point___getitem__(const OT::Point*, PyObject*)’:
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:4565:7: error: ‘PyInt_Check’ was not declared in this scope; did you mean ‘PySet_Check’?
 4565 |   if (PyInt_Check(arg))
      |       ^~~~~~~~~~~
      |       PySet_Check
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:4627:18: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 4627 |     long index = PyInt_AsLong(intValue.get());
      |                  ^~~~~~~~~~~~
      |                  PyLong_AsLong
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx: In function ‘PyObject* OT_Sample___getitem____SWIG_1(const OT::Sample*, PyObject*)’:
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8067:20: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 8067 |       long index = PyInt_AsLong(intValue.get());
      |                    ^~~~~~~~~~~~
      |                    PyLong_AsLong
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8134:13: error: ‘PyInt_Check’ was not declared in this scope; did you mean ‘PySet_Check’?
 8134 |         if (PyInt_Check(elt))
      |             ^~~~~~~~~~~
      |             PySet_Check
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8136:25: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 8136 |           long index2 = PyInt_AsLong(elt);
      |                         ^~~~~~~~~~~~
      |                         PyLong_AsLong
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8211:13: error: ‘PyInt_Check’ was not declared in this scope; did you mean ‘PySet_Check’?
 8211 |         if (PyInt_Check(elt))
      |             ^~~~~~~~~~~
      |             PySet_Check
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8213:25: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 8213 |           long index2 = PyInt_AsLong(elt);
      |                         ^~~~~~~~~~~~
      |                         PyLong_AsLong
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8242:11: error: ‘PyInt_Check’ was not declared in this scope; did you mean ‘PySet_Check’?
 8242 |       if (PyInt_Check(elt))
      |           ^~~~~~~~~~~
      |           PySet_Check
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8244:23: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 8244 |         long index1 = PyInt_AsLong(elt);
      |                       ^~~~~~~~~~~~
      |                       PyLong_AsLong
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8304:13: error: ‘PyInt_Check’ was not declared in this scope; did you mean ‘PySet_Check’?
 8304 |         if (PyInt_Check(elt))
      |             ^~~~~~~~~~~
      |             PySet_Check
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8306:25: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 8306 |           long index2 = PyInt_AsLong(elt);
      |                         ^~~~~~~~~~~~
      |                         PyLong_AsLong
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx: In function ‘void OT_Sample___setitem____SWIG_1(OT::Sample*, PyObject*, PyObject*)’:
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8391:20: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 8391 |       long index = PyInt_AsLong(intValue.get());
      |                    ^~~~~~~~~~~~
      |                    PyLong_AsLong
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8473:13: error: ‘PyInt_Check’ was not declared in this scope; did you mean ‘PySet_Check’?
 8473 |         if (PyInt_Check(elt))
      |             ^~~~~~~~~~~
      |             PySet_Check
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8475:25: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 8475 |           long index2 = PyInt_AsLong(elt);
      |                         ^~~~~~~~~~~~
      |                         PyLong_AsLong
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8556:13: error: ‘PyInt_Check’ was not declared in this scope; did you mean ‘PySet_Check’?
 8556 |         if (PyInt_Check(elt))
      |             ^~~~~~~~~~~
      |             PySet_Check
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8558:25: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 8558 |           long index2 = PyInt_AsLong(elt);
      |                         ^~~~~~~~~~~~
      |                         PyLong_AsLong
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8581:11: error: ‘PyInt_Check’ was not declared in this scope; did you mean ‘PySet_Check’?
 8581 |       if (PyInt_Check(elt))
      |           ^~~~~~~~~~~
      |           PySet_Check
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8583:23: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 8583 |         long index1 = PyInt_AsLong(elt);
      |                       ^~~~~~~~~~~~
      |                       PyLong_AsLong
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8641:13: error: ‘PyInt_Check’ was not declared in this scope; did you mean ‘PySet_Check’?
 8641 |         if (PyInt_Check(elt))
      |             ^~~~~~~~~~~
      |             PySet_Check
/<<PKGBUILDDIR>>/builddir/python/src/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx:8643:25: error: ‘PyInt_AsLong’ was not declared in this scope; did you mean ‘PyLong_AsLong’?
 8643 |           long index2 = PyInt_AsLong(elt);
      |                         ^~~~~~~~~~~~
      |                         PyLong_AsLong
make[4]: *** [python/src/CMakeFiles/typ.dir/build.make:82: python/src/CMakeFiles/typ.dir/CMakeFiles/typ.dir/typ_modulePYTHON_wrap.cxx.o] Error 1
make[4]: Leaving directory '/<<PKGBUILDDIR>>/builddir'
make[3]: *** [CMakeFiles/Makefile2:21508: python/src/CMakeFiles/typ.dir/all] Error 2
make[3]: Leaving directory '/<<PKGBUILDDIR>>/builddir'
make[2]: *** [Makefile:169: all] Error 2
make[2]: Leaving directory '/<<PKGBUILDDIR>>/builddir/python'
make[1]: *** [debian/rules:61: override_dh_auto_build] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:42: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2
--------------------------------------------------------------------------------

#1145499#10
Date:
2026-08-30 14:36:09 UTC
From:
To:
This issue is caused by the removal of the Python 2 compatibility macros in version 4.5.0 of SWIG. [1] According to the SWIG authors, these macros were retained in the generated code (pyhead.swg) solely for user typemaps. All typemap using these macros are updated to call the Python 3 C API directly.

I submitted a patch for fixing the issue as a merge request at Salsa. [2]

Note that the upstream authors have already addressed the issue with a similar patch [3]. However, this patch does not appear to be included in any released version of OpenTURNS.

Best,

Rafael Laboissière

[1] https://github.com/swig/swig/commit/79f7a2b7cb7ddc256eba09c8770133148025171d
[2] https://salsa.debian.org/science-team/openturns/-/merge_requests/3
[3] https://github.com/openturns/openturns/commit/559949dfeeb8305d41bd07e741636a6471e6cb27

#1145499#17
Date:
2026-09-01 19:57:28 UTC
From:
To:
Hi Rafael,

On Sun, 30 Aug 2026 16:36:09 +0200 Rafael Laboissièrere  <rafael@debian.org> wrote:
 > Control: tags -1 + patch upstream fixed-upstream
 >
 > This issue is caused by the removal of the Python 2 compatibility
macros in version 4.5.0 of SWIG. [1] According to the SWIG authors,
these macros were retained in the generated code (pyhead.swg) solely for
user typemaps. All typemap using these macros are updated to call the
Python 3 C API directly.
 >
 > I submitted a patch for fixing the issue as a merge request at Salsa. [2]
 >
 > Note that the upstream authors have already addressed the issue with
a similar patch [3]. However, this patch does not appear to be included
in any released version of OpenTURNS.
 >
 > Best,
 >
 > Rafael Laboissière
 >
 > [1]
https://github.com/swig/swig/commit/79f7a2b7cb7ddc256eba09c8770133148025171d
 > [2] https://salsa.debian.org/science-team/openturns/-/merge_requests/3
 > [3]
https://github.com/openturns/openturns/commit/559949dfeeb8305d41bd07e741636a6471e6cb27
 >
 >

Thanks for having monitored this!

Upstream just released version 1.27.3 with the fix, I am about to upload it.

Best wishes,

#1145499#22
Date:
2026-09-01 20:38:27 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
openturns, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1145499@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Pierre Gruet <pgt@debian.org> (supplier of updated openturns package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Tue, 01 Sep 2026 22:01:37 +0200
Source: openturns
Architecture: source
Version: 1.27.3-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Changed-By: Pierre Gruet <pgt@debian.org>
Closes: 1145499
Changes:
 openturns (1.27.3-1) unstable; urgency=medium
 .
   * New upstream version 1.27.3:
     - Handles the removal of the Python 2 compatibility macros in swig 4.5.0,
     thanks to Rafael Laboissière for finding out (Closes: #1145499)
   * Removing upstreamed patch
   * Switching to debhelper-compat 14:
     - Removing shlibs: and misc: substbvars
     - Removing the manual passing of CMAKE_BUILD_RPATH_USE_ORIGIN=ON to CMake
Checksums-Sha1:
 9d02eb5995245ec064ed0f60d6aecbda111834ee 2651 openturns_1.27.3-1.dsc
 abf4cf3970a197d9156296182789c6ae7879114f 14982009 openturns_1.27.3.orig.tar.gz
 56c15adabdf180a4357f00d260d3cec353105cb3 28256 openturns_1.27.3-1.debian.tar.xz
 d6bffff9f826a0ab10667a74401eb9c4df26ba79 7836 openturns_1.27.3-1_source.buildinfo
Checksums-Sha256:
 6734433b119353a755c35d70ebad301ece95be312c93969007a3f64848a9f168 2651 openturns_1.27.3-1.dsc
 6cd10e65682a09a5c8f7b40e3b4926d64fc93dcdff19c0e432ec843886cc1bc2 14982009 openturns_1.27.3.orig.tar.gz
 2a825d686c41fab68f5f20a55f1cdfb38ae73dbb7839f96858d10ff31668caf4 28256 openturns_1.27.3-1.debian.tar.xz
 e4d5777b1451a7750f9d67d69e4f10b8cba3c1d51a1bd127f7b344656fb00a39 7836 openturns_1.27.3-1_source.buildinfo
Files:
 4f13557d00c144c71a63e5a8cf4d8726 2651 science optional openturns_1.27.3-1.dsc
 5f228d869470ebb8449a36d89443fbef 14982009 science optional openturns_1.27.3.orig.tar.gz
 f03c58efe7715729be0d2fc59238d971 28256 science optional openturns_1.27.3-1.debian.tar.xz
 3c6b96ad8488fdc0828c9b95dd46a433 7836 science optional openturns_1.27.3-1_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEM8soQxPpC9J9y0UjYAMWptwndHYFAmqXL1wACgkQYAMWptwn
dHYhuw//WzNQJpKID0C5xc8FxO4N2PViyloHUPWwN/XLO4Zv+WKoJ79p/P+PSzO0
adPHCQ/umuVLZeKUaTCFOfVQXFE+hHk8dJQkKGfZ+wn3GVXqDAgQdasnFZeArLsU
7mV3kyf/+FvNvrEpLjzNjn8nqdMD5P7Y+JzuUHvNmtmw0ECHRHA1EybDAywJQUZe
XxHZ/UKJcHEvg5mK0c+kUco2D+od4QjCyvaL1oIZnStCcOY6gYdKt8H5Hb2O3GAX
mrdIir3Qbnc8IR+4h1AiHp0UB3ziZ+FRVdW9kVBEH2BVVL1qxk2p1thqX1FtuEZ3
ecMFFQHigPyCALrmV60LjDiWRQZqRTIoD8WQCIzL/GxmsQZfdwEy4xlvYmGXCT9x
vEwqUbiE9cqbRgWMgEAFFy5Zu/4iKT0ZBhi9tOmk4qCdXZy6WIvX/mbontHBoZlM
2R+h+7WOqpIa3WuZMSWEEjrZfjEj45L1l5VyRX6l6lsN90U/1qdunB0GTbF+NwwJ
yd6SDcThgFZU6kIDPYw0C2m9rlhCLu8gQMskSzHu54PJIWACeiHEwSheduoB9+CB
4bWRA6AC2alApSr4/d5KLHv2wcOCCGnv2Ss6DuhETK5gVgatc4/V0w2BV9evv9jz
ZP7b4Wyn0bdf1YyqgU3xIE2Uz+AuChG5u/fMk68cVZpAkM/fphI=
=mof+
-----END PGP SIGNATURE-----