Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test_importlib under WASI SDK 21 #115979

Closed
brettcannon opened this issue Feb 26, 2024 · 1 comment
Closed

Fix test_importlib under WASI SDK 21 #115979

brettcannon opened this issue Feb 26, 2024 · 1 comment
Assignees
Labels
3.11 only security fixes 3.12 bugs and security fixes 3.13 bugs and security fixes OS-wasi type-bug An unexpected behavior, bug, or error

Comments

@brettcannon
Copy link
Member

brettcannon commented Feb 26, 2024

Bug report

Bug description:

This very likely stems from dlopen() being available in WASI SDK 21 but not being usable dynamically as-is.

Test failure output
======================================================================
ERROR: test_is_package (test.test_importlib.extension.test_loader.Frozen_LoaderTests.test_is_package)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 86, in test_is_package
    self.assertFalse(self.loader.is_package(util.EXTENSIONS.name))
                     ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 1322, in is_package
  File "<frozen importlib._bootstrap_external>", line 134, in _path_split
  File "<frozen importlib._bootstrap_external>", line 134, in <genexpr>
AttributeError: 'NoneType' object has no attribute 'rfind'

======================================================================
ERROR: test_load_module_API (test.test_importlib.extension.test_loader.Frozen_LoaderTests.test_load_module_API)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 48, in test_load_module_API
    self.loader.load_module()
    ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "<frozen importlib._bootstrap_external>", line 668, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 1195, in load_module
  File "<frozen importlib._bootstrap_external>", line 1019, in load_module
  File "<frozen importlib._bootstrap>", line 531, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 673, in spec_from_loader
  File "<frozen importlib._bootstrap_external>", line 875, in spec_from_file_location
  File "<frozen importlib._bootstrap_external>", line 1322, in is_package
  File "<frozen importlib._bootstrap_external>", line 134, in _path_split
  File "<frozen importlib._bootstrap_external>", line 134, in <genexpr>
AttributeError: 'NoneType' object has no attribute 'rfind'

======================================================================
ERROR: test_module (test.test_importlib.extension.test_loader.Frozen_LoaderTests.test_module)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 55, in test_module
    module = self.load_module(util.EXTENSIONS.name)
             ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/test/test_importlib/extension/test_loader.py", line 32, in load_module
    return self.loader.load_module(fullname)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 668, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 1195, in load_module
  File "<frozen importlib._bootstrap_external>", line 1019, in load_module
  File "<frozen importlib._bootstrap>", line 531, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 673, in spec_from_loader
  File "<frozen importlib._bootstrap_external>", line 875, in spec_from_file_location
  File "<frozen importlib._bootstrap_external>", line 1322, in is_package
  File "<frozen importlib._bootstrap_external>", line 134, in _path_split
  File "<frozen importlib._bootstrap_external>", line 134, in <genexpr>
AttributeError: 'NoneType' object has no attribute 'rfind'

======================================================================
ERROR: test_module_reuse (test.test_importlib.extension.test_loader.Frozen_LoaderTests.test_module_reuse)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 81, in test_module_reuse
    module1 = self.load_module(util.EXTENSIONS.name)
              ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/test/test_importlib/extension/test_loader.py", line 32, in load_module
    return self.loader.load_module(fullname)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 668, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 1195, in load_module
  File "<frozen importlib._bootstrap_external>", line 1019, in load_module
  File "<frozen importlib._bootstrap>", line 531, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 673, in spec_from_loader
  File "<frozen importlib._bootstrap_external>", line 875, in spec_from_file_location
  File "<frozen importlib._bootstrap_external>", line 1322, in is_package
  File "<frozen importlib._bootstrap_external>", line 134, in _path_split
  File "<frozen importlib._bootstrap_external>", line 134, in <genexpr>
AttributeError: 'NoneType' object has no attribute 'rfind'

======================================================================
ERROR: test_is_package (test.test_importlib.extension.test_loader.Source_LoaderTests.test_is_package)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 86, in test_is_package
    self.assertFalse(self.loader.is_package(util.EXTENSIONS.name))
                     ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 1322, in is_package
    file_name = _path_split(self.path)[1]
                ~~~~~~~~~~~^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 134, in _path_split
    i = max(path.rfind(p) for p in path_separators)
        ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 134, in <genexpr>
    i = max(path.rfind(p) for p in path_separators)
            ^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'rfind'

======================================================================
ERROR: test_load_module_API (test.test_importlib.extension.test_loader.Source_LoaderTests.test_load_module_API)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 48, in test_load_module_API
    self.loader.load_module()
    ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Lib/importlib/_bootstrap_external.py", line 668, in _check_name_wrapper
    return method(self, name, *args, **kwargs)
           ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 1195, in load_module
    return super(FileLoader, self).load_module(fullname)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 1019, in load_module
    return _bootstrap._load_module_shim(self, fullname)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap.py", line 531, in _load_module_shim
    spec = spec_from_loader(fullname, self)
           ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap.py", line 673, in spec_from_loader
    return spec_from_file_location(name, loader=loader)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 875, in spec_from_file_location
    is_package = loader.is_package(name)
                 ~~~~~~~~~~~~~~~~~^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 1322, in is_package
    file_name = _path_split(self.path)[1]
                ~~~~~~~~~~~^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 134, in _path_split
    i = max(path.rfind(p) for p in path_separators)
        ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 134, in <genexpr>
    i = max(path.rfind(p) for p in path_separators)
            ^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'rfind'

======================================================================
ERROR: test_module (test.test_importlib.extension.test_loader.Source_LoaderTests.test_module)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 55, in test_module
    module = self.load_module(util.EXTENSIONS.name)
             ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/test/test_importlib/extension/test_loader.py", line 32, in load_module
    return self.loader.load_module(fullname)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 668, in _check_name_wrapper
    return method(self, name, *args, **kwargs)
           ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 1195, in load_module
    return super(FileLoader, self).load_module(fullname)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 1019, in load_module
    return _bootstrap._load_module_shim(self, fullname)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap.py", line 531, in _load_module_shim
    spec = spec_from_loader(fullname, self)
           ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap.py", line 673, in spec_from_loader
    return spec_from_file_location(name, loader=loader)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 875, in spec_from_file_location
    is_package = loader.is_package(name)
                 ~~~~~~~~~~~~~~~~~^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 1322, in is_package
    file_name = _path_split(self.path)[1]
                ~~~~~~~~~~~^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 134, in _path_split
    i = max(path.rfind(p) for p in path_separators)
        ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 134, in <genexpr>
    i = max(path.rfind(p) for p in path_separators)
            ^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'rfind'

======================================================================
ERROR: test_module_reuse (test.test_importlib.extension.test_loader.Source_LoaderTests.test_module_reuse)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 81, in test_module_reuse
    module1 = self.load_module(util.EXTENSIONS.name)
              ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/test/test_importlib/extension/test_loader.py", line 32, in load_module
    return self.loader.load_module(fullname)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 668, in _check_name_wrapper
    return method(self, name, *args, **kwargs)
           ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 1195, in load_module
    return super(FileLoader, self).load_module(fullname)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 1019, in load_module
    return _bootstrap._load_module_shim(self, fullname)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap.py", line 531, in _load_module_shim
    spec = spec_from_loader(fullname, self)
           ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap.py", line 673, in spec_from_loader
    return spec_from_file_location(name, loader=loader)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 875, in spec_from_file_location
    is_package = loader.is_package(name)
                 ~~~~~~~~~~~~~~~~~^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 1322, in is_package
    file_name = _path_split(self.path)[1]
                ~~~~~~~~~~~^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 134, in _path_split
    i = max(path.rfind(p) for p in path_separators)
        ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/importlib/_bootstrap_external.py", line 134, in <genexpr>
    i = max(path.rfind(p) for p in path_separators)
            ^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'rfind'

======================================================================
FAIL: test_module (test.test_importlib.extension.test_finder.Frozen_FinderTests.test_module)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_finder.py", line 29, in test_module
    self.assertTrue(self.find_spec(util.EXTENSIONS.name))
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None is not true

======================================================================
FAIL: test_module (test.test_importlib.extension.test_finder.Source_FinderTests.test_module)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_finder.py", line 29, in test_module
    self.assertTrue(self.find_spec(util.EXTENSIONS.name))
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None is not true

======================================================================
FAIL: test_bad_modules (test.test_importlib.extension.test_loader.Frozen_MultiPhaseExtensionModuleTests.test_bad_modules)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_functionality (test.test_importlib.extension.test_loader.Frozen_MultiPhaseExtensionModuleTests.test_functionality)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_load_short_name (test.test_importlib.extension.test_loader.Frozen_MultiPhaseExtensionModuleTests.test_load_short_name)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_load_submodule (test.test_importlib.extension.test_loader.Frozen_MultiPhaseExtensionModuleTests.test_load_submodule)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_load_twice (test.test_importlib.extension.test_loader.Frozen_MultiPhaseExtensionModuleTests.test_load_twice)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_module (test.test_importlib.extension.test_loader.Frozen_MultiPhaseExtensionModuleTests.test_module)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_nonascii (test.test_importlib.extension.test_loader.Frozen_MultiPhaseExtensionModuleTests.test_nonascii)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_nonmodule (test.test_importlib.extension.test_loader.Frozen_MultiPhaseExtensionModuleTests.test_nonmodule)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_nonmodule_with_methods (test.test_importlib.extension.test_loader.Frozen_MultiPhaseExtensionModuleTests.test_nonmodule_with_methods)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_null_slots (test.test_importlib.extension.test_loader.Frozen_MultiPhaseExtensionModuleTests.test_null_slots)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_reload (test.test_importlib.extension.test_loader.Frozen_MultiPhaseExtensionModuleTests.test_reload)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_try_registration (test.test_importlib.extension.test_loader.Frozen_MultiPhaseExtensionModuleTests.test_try_registration)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_unloadable (test.test_importlib.extension.test_loader.Frozen_MultiPhaseExtensionModuleTests.test_unloadable)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_unloadable_nonascii (test.test_importlib.extension.test_loader.Frozen_MultiPhaseExtensionModuleTests.test_unloadable_nonascii)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_module (test.test_importlib.extension.test_loader.Frozen_SinglePhaseExtensionModuleTests.test_module)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 111, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_unloadable (test.test_importlib.extension.test_loader.Frozen_SinglePhaseExtensionModuleTests.test_unloadable)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 111, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_unloadable_nonascii (test.test_importlib.extension.test_loader.Frozen_SinglePhaseExtensionModuleTests.test_unloadable_nonascii)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 111, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_bad_modules (test.test_importlib.extension.test_loader.Source_MultiPhaseExtensionModuleTests.test_bad_modules)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_functionality (test.test_importlib.extension.test_loader.Source_MultiPhaseExtensionModuleTests.test_functionality)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_load_short_name (test.test_importlib.extension.test_loader.Source_MultiPhaseExtensionModuleTests.test_load_short_name)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_load_submodule (test.test_importlib.extension.test_loader.Source_MultiPhaseExtensionModuleTests.test_load_submodule)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_load_twice (test.test_importlib.extension.test_loader.Source_MultiPhaseExtensionModuleTests.test_load_twice)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_module (test.test_importlib.extension.test_loader.Source_MultiPhaseExtensionModuleTests.test_module)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_nonascii (test.test_importlib.extension.test_loader.Source_MultiPhaseExtensionModuleTests.test_nonascii)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_nonmodule (test.test_importlib.extension.test_loader.Source_MultiPhaseExtensionModuleTests.test_nonmodule)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_nonmodule_with_methods (test.test_importlib.extension.test_loader.Source_MultiPhaseExtensionModuleTests.test_nonmodule_with_methods)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_null_slots (test.test_importlib.extension.test_loader.Source_MultiPhaseExtensionModuleTests.test_null_slots)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_reload (test.test_importlib.extension.test_loader.Source_MultiPhaseExtensionModuleTests.test_reload)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_try_registration (test.test_importlib.extension.test_loader.Source_MultiPhaseExtensionModuleTests.test_try_registration)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_unloadable (test.test_importlib.extension.test_loader.Source_MultiPhaseExtensionModuleTests.test_unloadable)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_unloadable_nonascii (test.test_importlib.extension.test_loader.Source_MultiPhaseExtensionModuleTests.test_unloadable_nonascii)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 192, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_module (test.test_importlib.extension.test_loader.Source_SinglePhaseExtensionModuleTests.test_module)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 111, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_unloadable (test.test_importlib.extension.test_loader.Source_SinglePhaseExtensionModuleTests.test_unloadable)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 111, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_unloadable_nonascii (test.test_importlib.extension.test_loader.Source_SinglePhaseExtensionModuleTests.test_unloadable_nonascii)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/extension/test_loader.py", line 111, in setUp
    assert self.spec
           ^^^^^^^^^
AssertionError

======================================================================
FAIL: test_spec_from_file_location_smsl_default (test.test_importlib.test_spec.Frozen_FactoryTests.test_spec_from_file_location_smsl_default)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/test_spec.py", line 629, in test_spec_from_file_location_smsl_default
    self.assertEqual(spec.submodule_search_locations, [os.getcwd()])
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Lists differ: [''] != ['/']

First differing element 0:
''
'/'

- ['']
+ ['/']
?   +


======================================================================
FAIL: test_spec_from_file_location_smsl_empty (test.test_importlib.test_spec.Frozen_FactoryTests.test_spec_from_file_location_smsl_empty)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/test_spec.py", line 604, in test_spec_from_file_location_smsl_empty
    self.assertEqual(spec.submodule_search_locations, [os.getcwd()])
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Lists differ: [''] != ['/']

First differing element 0:
''
'/'

- ['']
+ ['/']
?   +


======================================================================
FAIL: test_spec_from_loader_is_package_true_with_fileloader (test.test_importlib.test_spec.Frozen_FactoryTests.test_spec_from_loader_is_package_true_with_fileloader)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/test_spec.py", line 505, in test_spec_from_loader_is_package_true_with_fileloader
    self.assertEqual(spec.submodule_search_locations, [os.getcwd()])
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Lists differ: [''] != ['/']

First differing element 0:
''
'/'

- ['']
+ ['/']
?   +


======================================================================
FAIL: test_spec_from_file_location_smsl_default (test.test_importlib.test_spec.Source_FactoryTests.test_spec_from_file_location_smsl_default)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/test_spec.py", line 629, in test_spec_from_file_location_smsl_default
    self.assertEqual(spec.submodule_search_locations, [os.getcwd()])
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Lists differ: [''] != ['/']

First differing element 0:
''
'/'

- ['']
+ ['/']
?   +


======================================================================
FAIL: test_spec_from_file_location_smsl_empty (test.test_importlib.test_spec.Source_FactoryTests.test_spec_from_file_location_smsl_empty)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/test_spec.py", line 604, in test_spec_from_file_location_smsl_empty
    self.assertEqual(spec.submodule_search_locations, [os.getcwd()])
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Lists differ: [''] != ['/']

First differing element 0:
''
'/'

- ['']
+ ['/']
?   +


======================================================================
FAIL: test_spec_from_loader_is_package_true_with_fileloader (test.test_importlib.test_spec.Source_FactoryTests.test_spec_from_loader_is_package_true_with_fileloader)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/test_spec.py", line 505, in test_spec_from_loader_is_package_true_with_fileloader
    self.assertEqual(spec.submodule_search_locations, [os.getcwd()])
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Lists differ: [''] != ['/']

First differing element 0:
''
'/'

- ['']
+ ['/']
?   +


======================================================================
FAIL: test_cache_from_source_respects_pycache_prefix_relative (test.test_importlib.test_util.Frozen_PEP3147Tests.test_cache_from_source_respects_pycache_prefix_relative)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/test_util.py", line 578, in test_cache_from_source_respects_pycache_prefix_relative
    self.assertEqual(
    ~~~~~~~~~~~~~~~~^
        self.util.cache_from_source(path, optimization=''),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        expect)
        ^^^^^^^
AssertionError: '/tmp/bytecode/foo/bar/baz/qux.cpython-313.pyc' != '/tmp/bytecode/./foo/bar/baz/qux.cpython-313.pyc'
- /tmp/bytecode/foo/bar/baz/qux.cpython-313.pyc
+ /tmp/bytecode/./foo/bar/baz/qux.cpython-313.pyc
?              ++


======================================================================
FAIL: test_cache_from_source_respects_pycache_prefix_relative (test.test_importlib.test_util.Source_PEP3147Tests.test_cache_from_source_respects_pycache_prefix_relative)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_importlib/test_util.py", line 578, in test_cache_from_source_respects_pycache_prefix_relative
    self.assertEqual(
    ~~~~~~~~~~~~~~~~^
        self.util.cache_from_source(path, optimization=''),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        expect)
        ^^^^^^^
AssertionError: '/tmp/bytecode/foo/bar/baz/qux.cpython-313.pyc' != '/tmp/bytecode/./foo/bar/baz/qux.cpython-313.pyc'
- /tmp/bytecode/foo/bar/baz/qux.cpython-313.pyc
+ /tmp/bytecode/./foo/bar/baz/qux.cpython-313.pyc
?              ++

CPython versions tested on:

CPython main branch

Operating systems tested on:

Other

Linked PRs

@brettcannon brettcannon added type-bug An unexpected behavior, bug, or error OS-wasi labels Feb 26, 2024
@brettcannon brettcannon added 3.13 bugs and security fixes 3.11 only security fixes 3.12 bugs and security fixes labels Feb 26, 2024
@brettcannon brettcannon self-assigned this Mar 13, 2024
@brettcannon
Copy link
Member Author

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Mar 13, 2024
brettcannon added a commit that referenced this issue Mar 13, 2024
…-116754) (GH-116759)

GH-115979: update test_importlib to work under WASI SDK 21 (GH-116754)
(cherry picked from commit 61733a2)

Co-authored-by: Brett Cannon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes 3.12 bugs and security fixes 3.13 bugs and security fixes OS-wasi type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant