Bugs item #1573180, was opened at 2006-10-08 16:01 Message generated for change (Comment added) made by eolebigot You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1573180&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Interpreter Core Group: Python 2.5 Status: Closed Resolution: Invalid Priority: 5 Submitted By: E.-O. Le Bigot (eolebigot) Assigned to: Nobody/Anonymous (nobody) Summary: import org.python.core imports local org.py Initial Comment: It seems to me that the fact that "import org.python.core" imports a local "org.py" file is not the intended behavior. Here are the details: ---------------------------------------- % python -m org.python.core Traceback (most recent call last): File "/sw/lib/python2.5/runpy.py", line 85, in run_module loader = get_loader(mod_name) File "/sw/lib/python2.5/pkgutil.py", line 456, in get_loader return find_loader(fullname) File "/sw/lib/python2.5/pkgutil.py", line 466, in find_loader for importer in iter_importers(fullname): File "/sw/lib/python2.5/pkgutil.py", line 422, in iter_importers __import__(pkg) File "org.py", line 1, in <module> test NameError: name 'test' is not defined % cat org.py test ---------------------------------------- Best wishes, EOL ---------------------------------------------------------------------- >Comment By: E.-O. Le Bigot (eolebigot) Date: 2006-10-08 19:16 Message: Logged In: YES user_id=1440667 >From the doc: http://docs.python.org/tut/node8.html#SECTION008400000000000000000 I had understood that the search performed during the import process involved looking in "subdirectories": I thought that "import org.python.core" would first search for an "org/" directory and not for an "org.py" file. But I'm no expert in imports with "dotted" packages... EOL ---------------------------------------------------------------------- Comment By: Georg Brandl (gbrandl) Date: 2006-10-08 17:52 Message: Logged In: YES user_id=849994 Why shouldn't "import org.python.core" first import org.py, the org/python.py, then org/python/core.py, in CPython? The current directory is on sys.path for -m arguments, so the "local" org.py is imported. The name "org.python.core" somehow reminds me of Jython. If this is a Jython issue, it doesn't belong in this tracker. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1573180&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com