Issue1742

classification
Title: Finders in sys.meta_path do not work for Java modules in packages
Type: Severity: normal
Components: Core Versions: Jython 2.5
process
Status: open Resolution: remind
Dependencies: Superseder:
Assigned To: Nosy List: fwierzbicki, geoffbache, nonameentername, zyasoft
Priority: low Keywords:

Created on 2011-04-26.14:11:01 by geoffbache, last changed 2014-09-17.02:20:34 by zyasoft.

Messages
msg6515 (view) Author: Geoff Bache (geoffbache) Date: 2011-04-26.14:11:01
sys.meta_path is documented as for CPython, but it only seems to work for imports of Python modules. For example, if you run this code:

import sys

class MyFinder:
   def find_module(self, name, *args):
       print "Checking", name

sys.meta_path = [ MyFinder() ]

print "Importing xml.sax.handler..."
import xml.sax.handler
print "Importing javax.swing..."
import javax.swing

and note that when importing the Python module xml.sax.handler,
"find_module" gets called for every submodule as expected. When
importing javax.swing, it is called only once, on "javax", despite
"javax.swing" also being added to sys.modules. This seems to be the
case for any java package, i.e. only the top level interacts with
sys.meta_path, which as it's usually something like "org" or "com"
makes it not very useful.

This should either work (preferably) or be documented as not working.
History
Date User Action Args
2014-09-17 02:20:34zyasoftsetnosy: + nonameentername
2014-09-17 02:20:00zyasoftsetnosy: + zyasoft
2013-02-19 23:56:59fwierzbickisetfiles: - generictramadolhclonline.html
2013-02-19 23:56:36fwierzbickisetfiles: - cheapcodfedextramadolvery.html
2013-02-19 23:56:25fwierzbickisetpriority: low
nosy: + fwierzbicki
resolution: remind
versions: + Jython 2.5, - 2.5.2rc
2011-07-27 12:48:05junior1971setfiles: + generictramadolhclonline.html
2011-07-27 12:03:41junior1971setfiles: + cheapcodfedextramadolvery.html
2011-04-26 14:11:01geoffbachecreate