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


Groups > comp.lang.python > #72550

Re: Loading modules from files through C++

Date 2014-06-03 23:06 +0200
From Roland Plüss <roland@rptd.ch>
Subject Re: Loading modules from files through C++
References (11 earlier) <CAPTjJmrOeSsmoxqk8iCL2tKEX9Qa1yHBLzfbfvNr_7Ap+AP6pg@mail.gmail.com> <537B8E31.7000607@rptd.ch> <CAPTjJmrnjrfhd=nLKogVkdsm-_KzG6mRKrFbCVYhaXdv6-Ortw@mail.gmail.com> <537D2433.7080606@rptd.ch> <5380B137.2030106@rptd.ch>
Newsgroups comp.lang.python
Message-ID <mailman.10645.1401829890.18130.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

I came now a bit further with Python 3 but I'm hitting a total
road-block right now with the importer in C++ which worked in Py2 but is
now totally broken in Py3. In general I've got a C++ class based module
which has two methods:

{ "find_module", ( PyCFunction )spModuleModuleLoader::cfFindModule,
METH_VARARGS, "Retrieve finder for a path." },
{ "load_module", ( PyCFunction )spModuleModuleLoader::cfLoadModule,
METH_VARARGS, "Load module for a path." },

An instance of this object is added to sys.meta_path

This is the same as with Py2. But in Py3 I get now this strange error
and everything breaks:

Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1523, in
_find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1477, in _find_module
SystemError: Bad call flags in PyCFunction_Call. METH_OLDARGS is no
longer supported!

This happenes whenever I try to import something. I never used
METH_OLDARGS anywhere so I assume something is broken inside python.
Maybe wrong error code for not finding some method or wrong arguments? I
can't find any useful documentation on what could cause this problem.

-- 
Yours sincerely
Plüss Roland

Leader and Head Programmer
- Game: Epsylon ( http://www.indiedb.com/games/epsylon )
- Game Engine: Drag[en]gine ( http://www.indiedb.com/engines/dragengine
, http://dragengine.rptd.ch/wiki )
- Normal Map Generator: DENormGen ( http://epsylon.rptd.ch/denormgen.php )
- As well as various Blender export scripts und game tools

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Loading modules from files through C++ Roland Plüss <roland@rptd.ch> - 2014-06-03 23:06 +0200

csiph-web