[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] fix unable to load *.pyd files with Python 3.8.x on Windows

From: Jun Omae <jun66j5_at_gmail.com>
Date: Fri, 15 May 2020 18:27:03 +0900

On Wed, May 13, 2020 at 5:56 PM Jun Omae <jun66j5_at_gmail.com> wrote:
> At least, I think we should use python_d.exe when debug configuration.
> ...
> Python bindings with debug configuration for Python 3.x has something wrong.
>
> [[[
> -- Running Swig Python tests --
> Traceback (most recent call last):
> File "C:\usr\src\subversion\trunk-py3\Debug\swig\pylib\libsvn\core.py", line 14, in swig_import_helper
> return importlib.import_module(mname)
> File "C:\usr\apps\python37\lib\importlib\__init__.py", line 127, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
> File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
> File "<frozen importlib._bootstrap>", line 983, in _find_and_load
> File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
> ModuleNotFoundError: No module named 'libsvn._core'
> ]]]

According to Build and C API Changes in Python 3.5 [1], extension module should end with
`{name}_d.pyd` rather than `{name}.pyd` in debug mode.

After py35-windows-debug-pyd.diff, win-tests.py --debug --swig=python is able to run tests.

On Python 3.7.7 with SWIG 3.0.12, the following assertion raises. The assertion has been
reported and in SWIG #1321 [2] and fixed in SWIG 4.0.1.

[[[
Testing Debug configuration on local repository.
-- Running Swig Python tests --
.............................Fatal Python error: ..\Objects\dictobject.c:1905 object at 0000018C25A37C28 has negative ref count -2459565876494606884
]]]

On Python 3.7.7 with SWIG 4.0.1, another assertion raises.

[[[
Testing Debug configuration on local repository.
-- Running Swig Python tests --
Assertion failed: PyTuple_Check(args), file ..\Objects\typeobject.c, line 3670
[Test runner reported failure]
]]]

[1] https://docs.python.org/3/whatsnew/3.5.html#build-and-c-api-changes
[2] https://github.com/swig/swig/issues/1321

-- 
Jun Omae <jun66j5_at_gmail.com> (大前 潤)

Received on 2020-05-15 11:27:15 CEST

This is an archived mail posted to the Subversion Dev mailing list.