A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2016-May/144797.html below:

[Python-Dev] embedding - PyImport_AppendInittab() after Py_Initialize()

[Python-Dev] embedding - PyImport_AppendInittab() after Py_Initialize() [Python-Dev] embedding - PyImport_AppendInittab() after Py_Initialize()Brett Cannon brett at python.org
Mon May 30 17:59:29 EDT 2016
On Fri, 27 May 2016 at 07:50 Vitaly Murashev <vitaly.murashev at gmail.com>
wrote:

> Could anyone please clarify whether it is correct in python3.5 to call
> PyImport_AppendInittab() after Py_Initialize()
>

It should be called before as PyImport_AppendInittab() is shorthand for
PyImport_ExtendInittab() and it says to call prior to Py_Initialize():
https://github.com/python/cpython/blob/f680b517e2701e9a3859afb62628a46eccdce17c/Python/import.c#L2153
 .

-Brett


>
> I found this case among the tests for boost.python
> https://github.com/boostorg/python/blob/develop/test/exec.cpp
>
> And this test doesn't work for me with python3.5.An error looks like:
>
> exec.cpp(137): Python Error detected in function 'void __cdecl
> check_pyerr(bool)'
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
> ImportError: 'embedded_hello' is not a built-in module
> 1 error detected.
>
> After debugging I found out that root cause is in
> importlib/_bootstrap.py which do the following:
>
>         if fullname not in sys.builtin_module_names:
>             raise ImportError('{!r} is not a built-in
> module'.format(fullname), name=fullname)
>
> but sys.builtin_module_names is the constant which initialized once in
> Py_Initialize()
>
> ---
> To summarize:
> Is it a bug in python3.5 or original test inside boost.python should be
> fixed ?
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/brett%40python.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20160530/54b50cd9/attachment.html>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4