[Python-Dev] Getting importlib into the standard library for 3.1

Brett Cannon brett at python.org
Thu Jan 8 22:02:28 CET 2009


On Thu, Jan 8, 2009 at 12:57, Paul Moore <p.f.moore at gmail.com> wrote:
> 2009/1/8 Brett Cannon <brett at python.org>:
>> Thanks, Paul! I changed it to _os.getcwd() since that's what nt exposes.
>
> Ta. I wasn't sure _os.getcwd() returned a full pathname.
>
> The only difference between the importlib results and the normal ones
> seems to be that with importlib, test_multiprocessing is skipped,
> whereas with the normal import, it fails. The importlib result is
>
> test_multiprocessing skipped -- No module named test.test_support
>

Well, that should fail since test.test_support doesn't exist in Python 3.0.

> where the normal result is
>
> test_multiprocessing
> Traceback (most recent call last):
>  File "<string>", line 1, in <module>
>  File "C:\Apps\Python30\lib\multiprocessing\forking.py", line 342, in main
> Traceback (most recent call last):
>  File "<string>", line 1, in <module>
>  File "C:\Apps\Python30\lib\multiprocessing\forking.py", line 342, in main
>    prepare(preparation_data)
>    prepare(preparation_data)
>  File "C:\Apps\Python30\lib\multiprocessing\forking.py", line 451, in prepare
>    file, path_name, etc = imp.find_module(main_name, dirs)
> ImportError: No module named <dummy>
>  File "C:\Apps\Python30\lib\multiprocessing\forking.py", line 451, in prepare
>    file, path_name, etc = imp.find_module(main_name, dirs)
> ImportError: No module named <dummy>
> Traceback (most recent call last):
>  File "<string>", line 1, in <module>
>  File "C:\Apps\Python30\lib\multiprocessing\forking.py", line 342, in main
>    prepare(preparation_data)
>  File "C:\Apps\Python30\lib\multiprocessing\forking.py", line 451, in prepare
>    file, path_name, etc = imp.find_module(main_name, dirs)
> ImportError: No module named <dummy>
> Traceback (most recent call last):
>  File "<string>", line 1, in <module>
>  File "C:\Apps\Python30\lib\multiprocessing\forking.py", line 342, in main
>    prepare(preparation_data)
>  File "C:\Apps\Python30\lib\multiprocessing\forking.py", line 451, in prepare
>    file, path_name, etc = imp.find_module(main_name, dirs)
> ImportError: No module named <dummy>
> Traceback (most recent call last):
>  File "<string>", line 1, in <module>
>  File "C:\Apps\Python30\lib\multiprocessing\forking.py", line 342, in main
>    prepare(preparation_data)
>  File "C:\Apps\Python30\lib\multiprocessing\forking.py", line 451, in prepare
>    file, path_name, etc = imp.find_module(main_name, dirs)
> ImportError: No module named <dummy>
> test test_multiprocessing crashed -- <class 'EOFError'>:
>
> My command line was
>
> \Apps\Python30\python.exe -c "import sys; sys.argv = ['<dummy>',
> 'test_pkg', 'test_pydoc', 'test_shlex', 'test_pep263',
> 'test_distutils', 'test_lib2to3', 'test_pep3120', 'test_import']; from
> test.regrtest import main; main(exclude=True)"
>

This looks like test_subprocessing tries to snag some detail about
what module __main__ is based on the first value of sys.argv.

-Brett


More information about the Python-Dev mailing list