[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: Johan Corveleyn <jcorvel_at_gmail.com>
Date: Sat, 16 May 2020 14:13:42 +0200

On Fri, May 15, 2020 at 11:27 AM Jun Omae <jun66j5_at_gmail.com> wrote:
>
> 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

Thanks. Another step forward.

If I apply your patch, I get this assertion with Python 3.8.2 and SWIG 3.0.12:

[[[
C:\research\svn\dev\trunk>python win-tests.py --log-level=DEBUG
--debug --swig=python R:\test_py
Testing Debug configuration on local repository.
-- Running Swig Python tests --
Assertion failed: PyTuple_Check(args), file
d:\a\1\s\objects\typeobject.c, line 3707
[Test runner reported failure]
]]]

I don't see the other assertion that you got with SWIG 3.0.12. Perhaps
because I'm using Python 3.8.2? Or because I'm using the 32-bit
builds? I don't know.

-- 
Johan
Received on 2020-05-16 14:14:02 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.