[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-11-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: Documentation is fixed, behavior cannot be changed. Close the issue -- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed ___ Python tracker

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-11-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 94de77bd0b4b by Andrew Svetlov in branch '2.7': Issue #16194: document imp.load_dynamic problems http://hg.python.org/cpython/rev/94de77bd0b4b -- nosy: +python-dev ___ Python tracker

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-11-29 Thread Brett Cannon
Brett Cannon added the comment: The doc patch LGTM. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-11-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: Pushed doc patch. Nick, is it good for you? -- Added file: http://bugs.python.org/file28159/issue16194.diff ___ Python tracker ___ _

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-11-29 Thread Nick Coghlan
Nick Coghlan added the comment: The behaviour won't change in 2.7, but the docs at http://docs.python.org/2/library/imp.html#imp.load_dynamic still need to be clarified. e.g. add a note like: Note: the import internals identify extension modules by filename, so doing ``foo = load_dynamic("fo

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-11-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: I think it should not be fixed in 2.7, so I guess to close the issue as wontfix. -- nosy: +asvetlov ___ Python tracker ___ _

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-11-12 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-11-06 Thread Václav Šmilauer
Václav Šmilauer added the comment: issue16421 was opened for py3k. Just for the sport of writing, I fixed that in python 2.7 (tip) as well, though other seemed to defend the view it was not a bug, hence not fixable in 2.7. -- keywords: +patch versions: -Python 3.2, Python 3.3 Added fi

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-17 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-17 Thread R. David Murray
R. David Murray added the comment: Yes, I think keeping this bug as the doc bug and opening a new one for the enhancement is the best way to go. -- versions: +Python 3.2, Python 3.3 ___ Python tracker

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-17 Thread Václav Šmilauer
Václav Šmilauer added the comment: Yes, that's what I suggested at the end of msg172656 - including modulename in the key. Brett, would it be OK if I make patch against 3.3 (or head, if you prefer) to key by (modulename,filename) for compiled modules? I had a look at importlib.machinery.Exten

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: """To prevent initializing an extension module more than once, we keep a static dictionary 'extensions' keyed by module name (for built-in modules) or by filename (for dynamically loaded modules), containing these modules. """ So there can be only

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Brett Cannon
Brett Cannon added the comment: The new functional equivalent is importlib.machinery.ExtensionFileLoader (http://docs.python.org/dev/py3k/library/importlib.html#importlib.machinery.ExtensionFileLoader), but underneath the hood it uses the same code as imp.load_dynamic() did. -- __

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Václav Šmilauer
Václav Šmilauer added the comment: I did not notice it was not documented in python 3.3 anymore -- my fault, sorry. In case there is no functional replacement for it, I will try to raise it on the ML. I am currently writing some code in 2.7 which relies on it (I don't see another way of packin

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Václav Šmilauer
Václav Šmilauer added the comment: I found the cause of the behavior (perhaps it is common knowledge, but I am new to python source); imp.load_dynamic calls the following functions Python/import.c: imp_load_dynamic (http://hg.python.org/cpython/file/ad51ed93377c/Python/import.c#l1777)

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Brett Cannon
Brett Cannon added the comment: Before this gets out of control I want to clarify that it is not "quite absurd" to label this a documentation bug and that is the proper classification for this bug. The documentation was not clear enough for you to understand what the behavior would be, so it s

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Václav Šmilauer
Václav Šmilauer added the comment: While I understand that this behavior went unnoticed for ages and can be seen therefore as unimportant, designating this as documentation bug is quite absurd; perhaps the following wording would be appropriate: .. note:: If this function is called multip

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Brett Cannon
Brett Cannon added the comment: It's actually a documentation bug. -- assignee: -> docs@python components: +Documentation -Library (Lib) keywords: +easy nosy: +docs@python ___ Python tracker __

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Václav Šmilauer
Václav Šmilauer added the comment: No, it is an old bug, since the behavior does something else than documented (http://docs.python.org/library/imp.html#imp.load_dynamic) and reasonably expected -- imp.load_dynamic("baz","foo.so") imports the "foo" module under some circumstances. --

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread R. David Murray
R. David Murray added the comment: This is an enhancement request, then. -- nosy: +r.david.murray stage: -> needs patch type: behavior -> enhancement versions: +Python 3.4 -Python 2.7 ___ Python tracker __

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Václav Šmilauer
Václav Šmilauer added the comment: I tried with python 2.4.5 and 2.5.2 in chroot (using ubuntu hardy, which packaged both of them) and the result is exactly the same for both. I doubt I am able to install anything older in a sensible manner. -- status: pending -> open

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Brett Cannon
Brett Cannon added the comment: Did this actually work in a previous version of Python, and if so what version? -- nosy: +brett.cannon status: open -> pending ___ Python tracker

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-11 Thread Václav Šmilauer
New submission from Václav Šmilauer: I have several compiled modules linked into one .so file and import them using imp.load_dynamic. Only the first module imported with load_dynamic is imported properly, all subsequent calls of load_dynamic on the same file ignore the first argument (name) a