Title: Support C_BUILTIN in _imp.load_module
Type: behaviour Severity: normal
Components: Core Versions: Jython 2.7
Status: open Resolution: accepted
Dependencies: Superseder:
Assigned To: jeff.allen Nosy List: jeff.allen, zyasoft
Priority: normal Keywords:

Created on 2015-05-10.15:59:48 by jeff.allen, last changed 2018-03-14.22:56:05 by jeff.allen.

msg10043 (view) Author: Jeff Allen (jeff.allen) Date: 2015-05-10.15:59:47
_imp.find_module returns, for a Java built-in module, a type of C_BUILTIN (=6), but _imp.load_module is then unable to load it, claiming it does not exist.

>>> import sys, imp
>>> file, filename, descr = imp.find_module("_marshal")
>>> descr
('', '', 6)
>>> imp.load_module("_marshal", file, filename, descr)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named _marshal
>>> import _marshal
>>> sys.modules['_marshal']
<type '_marshal'>

With this and #1906 we could revert to the CPython version of test_importhooks.
msg10044 (view) Author: Jim Baker (zyasoft) Date: 2015-05-11.02:57:37
+1, makes sense.
msg11803 (view) Author: Jeff Allen (jeff.allen) Date: 2018-03-14.22:56:05
Assigning to me in the hope I can work out what I was thinking 3 years ago.
Date User Action Args
2018-03-14 22:56:05jeff.allensetassignee: jeff.allen
resolution: accepted
messages: + msg11803
2015-05-11 02:57:37zyasoftsetnosy: + zyasoft
messages: + msg10044
2015-05-10 15:59:48jeff.allencreate