[issue4586] "Extending Embedded Python" documention uses removed Py_InitModule function
New submission from blake madden <[EMAIL PROTECTED]>: On the page: http://docs.python.org/3.0/extending/embedding.html#extending-embedded-python Note that the function "Py_InitModule" is used. From what I can tell, this function no longer exists and regrettably I can't figure out how to get "PyModule_Create" to work in its place. -- assignee: georg.brandl components: Documentation messages: 77273 nosy: blakemadden, georg.brandl severity: normal status: open title: "Extending Embedded Python" documention uses removed Py_InitModule function versions: Python 3.0 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4586> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4586] "Extending Embedded Python" documention uses removed Py_InitModule function
blake madden <[EMAIL PROTECTED]> added the comment: I am afraid that the webpage that I mentioned still uses "Py_InitModule", I just checked. How do I get embedding to work? Thanks. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4586> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4586] "Extending Embedded Python" documention uses removed Py_InitModule function
blake madden <[EMAIL PROTECTED]> added the comment: I took a look at the rst file in your comments and I tried that example (which uses PyModule_Create), but I am sorry to say that it doesn't work. It says "no module named emb". Are we sure that PyModule_Create is all that needs to be called? ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4586> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4592] PyModule_Create doesn't work (or example is missing something)
New submission from blake madden <[EMAIL PROTECTED]>: Following an example of how to extend and embed that I found in patch file r67655 (the website is out of date [issue4586]), PyModule_Create appears to not work (or example is not complete). When I run r67655 (attached also) I get an error saying that "emb" is not a module. -- components: Extension Modules files: python.cpp messages: 77307 nosy: blakemadden severity: normal status: open title: PyModule_Create doesn't work (or example is missing something) versions: Python 3.0 Added file: http://bugs.python.org/file12281/python.cpp ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4592> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4592] PyModule_Create doesn't work (or example is missing something)
blake madden <[EMAIL PROTECTED]> added the comment: It seems that a call to "PyDict_SetItemString" is what is missing from r67655: PyObject* m = PyModule_Create(&EmbModule); PyDict_SetItemString(PyImport_GetModuleDict(), EmbModule.m_name, m); I am just guessing here though, don't know if this is correct way to do things. -- assignee: -> georg.brandl components: +Documentation -Extension Modules nosy: +georg.brandl ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4592> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4592] Example patch is missing something
Changes by blake madden <[EMAIL PROTECTED]>: -- title: PyModule_Create doesn't work (or example is missing something) -> Example patch is missing something ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4592> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4595] new types example is out of date
New submission from blake madden <[EMAIL PROTECTED]>: http://docs.python.org/3.0/extending/newtypes.html This example is using Py_InitModule3, is this function removed in Python 3? -- assignee: georg.brandl components: Documentation messages: 77323 nosy: blakemadden, georg.brandl severity: normal status: open title: new types example is out of date versions: Python 3.0 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4595> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4612] PyModule_Create() doesn't add/import module
New submission from blake madden <[EMAIL PROTECTED]>: In reference to Issue4592 (which includes a patch), PyModule_Create()calls PyModule_New instead of PyImport_AddModule. Because of this, calling PyModule_Create() won't work like Py_InitModule(). Is this correct, because the documentation is showing that PyModule_Create() is all you need to use to create and add a module to the system. However, this is not the case. -- components: Extension Modules messages: 77428 nosy: blakemadden severity: normal status: open title: PyModule_Create() doesn't add/import module type: behavior versions: Python 3.0 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4612> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4612] PyModule_Create() doesn't add/import module
blake madden <[EMAIL PROTECTED]> added the comment: Sorry, mate, that's all Greek to me--I'm a total noob with Python. I'm simply trying to run the example in r67655 (the "Extending Embedded Python" example) and it fails with "'emb' not being found". It appears that calling "PyModule_Create(&EmbModule);" is not enough to create and import the library. Somebody made a comment in Issue4592 that "PyModule_Create" was missing some logic, so I'm reporting that here. I honestly don't know if there is something wrong with "PyModule_Create" or if the example is missing something. I'm just trying to get this example to work. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4612> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4592] Example patch is missing something
blake madden <[EMAIL PROTECTED]> added the comment: So, does that mean that Python is fine and there is a problem in the example? How do I get that example to work, there seems to be something missing in it. Thanks. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4592> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4586] "Extending Embedded Python" documention uses removed Py_InitModule function
blake madden <[EMAIL PROTECTED]> added the comment: "You are probably looking at http://docs.python.org/3.0/ still and that only updates when a new release happens." Didn't you just have a new release, Python 3? I thought the website said it was a stable release? The production help for Python 3 is using Py_InitModule, which doesn't even exist in the production release of Python 3. I stopped looking at that help when I figured that out, and after that I have been looking at the DEV help which (as you mentioned) does not work for other reasons. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4586> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com