Skip to content

test_importlib fails on Mac OSX 10.5.6 w/ case-sensitive file system #49692

Closed

Description

@donmez
mannequin
BPO 5442
Nosy @brettcannon
Files
  • case_sensitivity_tests.diff: Take 2 on fixing case-sensitivity detection
  • skip_bytecode_writing.diff: Tighten up skipping tests requiring sys.dont_write_bycode to be False
  • test_file_loader.diff: Fix test_file_loader for loss of writes_bytecode
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/brettcannon'
    closed_at = <Date 2009-05-11.01:47:24.104>
    created_at = <Date 2009-03-08.12:59:17.914>
    labels = ['tests', 'type-bug', 'library', 'release-blocker']
    title = 'test_importlib fails on Mac OSX 10.5.6 w/ case-sensitive file system'
    updated_at = <Date 2009-05-11.01:47:24.092>
    user = 'https://bugs.python.org/donmez'

    bugs.python.org fields:

    activity = <Date 2009-05-11.01:47:24.092>
    actor = 'brett.cannon'
    assignee = 'brett.cannon'
    closed = True
    closed_date = <Date 2009-05-11.01:47:24.104>
    closer = 'brett.cannon'
    components = ['Library (Lib)', 'Tests']
    creation = <Date 2009-03-08.12:59:17.914>
    creator = 'donmez'
    dependencies = []
    files = ['13916', '13946', '13950']
    hgrepos = []
    issue_num = 5442
    keywords = ['patch']
    message_count = 22.0
    messages = ['83308', '83329', '83330', '83331', '85164', '85340', '85373', '85473', '85554', '85558', '87366', '87390', '87391', '87401', '87414', '87425', '87450', '87515', '87516', '87538', '87548', '87559']
    nosy_count = 2.0
    nosy_names = ['brett.cannon', 'donmez']
    pr_nums = []
    priority = 'release blocker'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue5442'
    versions = ['Python 3.1']

    Activity

    1. donmez commented on Mar 8, 2009

      donmezmannequin
      MannequinAuthor

      Two failures in test_importlib:

      ======================================================================
      FAIL: test_case_insensitivity
      (importlib.test.extension.test_case_sensitivity.ExtensionModuleCaseSensi
      tivityTest)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/cartman/Downloads/Python-
      3.1a1/Lib/importlib/test/extension/test_case_sensitivity.py", line 29, 
      in test_case_insensitivity
          self.assert_(hasattr(loader, 'load_module'))
      AssertionError: None

      ======================================================================
      FAIL: test_insensitive
      (importlib.test.source.test_case_sensitivity.CaseSensitivityTest)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/cartman/Downloads/Python-
      3.1a1/Lib/importlib/test/source/test_case_sensitivity.py", line 49, in 
      test_insensitive
          self.assert_(hasattr(insensitive, 'load_module'))
      AssertionError: None

    2. added
      type-bugAn unexpected behavior, bug, or error
      on Mar 8, 2009
    3. added
      stdlibStandard Library Python modules in the Lib/ directory
      testsTests in the Lib/test dir
      on Mar 8, 2009
    4. brettcannon commented on Mar 8, 2009

      @brettcannon
      Member

      Is your version of OS X installed on a case-sensitive filesystem? These
      tests all pass for me on my Macbook on 10.5.6.

    5. self-assigned this
      on Mar 8, 2009
    6. donmez commented on Mar 8, 2009

      donmezmannequin
      MannequinAuthor

      Yes its case sensitive.

    7. brettcannon commented on Mar 8, 2009

      @brettcannon
      Member

      Ah, OK, that explains it then. I guess I need to come up with a test to
      verify whether commonly case-sensitive filesystems are truly
      case-sensitive before running the tests.

      Thanks for the quick response, Ismail.

    8. brettcannon commented on Apr 2, 2009

      @brettcannon
      Member

      Fixed in r71042.

    9. brettcannon commented on Apr 3, 2009

      @brettcannon
      Member

      If you could, Ismail, can you verify this either from svn or when the
      next release of 3.1 comes out and update this issue?

    10. donmez commented on Apr 4, 2009

      donmezmannequin
      MannequinAuthor

      Sure thing, I am waiting for alpha2.

      Regards.

    11. donmez commented on Apr 5, 2009

      donmezmannequin
      MannequinAuthor

      Still fails with 3.1 alpha2:

      ======================================================================
      ERROR: test_is_package
      (importlib.test.frozen.test_loader.InspectLoaderTests)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/frozen/test_loader.py", line 80, in 
      test_is_package
          result = machinery.FrozenImporter.is_package(name)
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/_bootstrap.py", line 191, in wrapper
          return fxn(self, fullname)
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/_bootstrap.py", line 301, in is_package
          return imp.is_frozen_package(fullname)
      AttributeError: 'module' object has no attribute 'is_frozen_package'

      ======================================================================
      ERROR: test_lacking_parent
      (importlib.test.source.test_abc_loader.PyLoaderTests)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_abc_loader.py", line 162, in 
      test_lacking_parent
          __loader__=mock)
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_abc_loader.py", line 128, in 
      eq_attrs
          "{} attribute: {} != {}".format(attr, found, val))
      ValueError: zero length field name in format

      ======================================================================
      ERROR: test_module (importlib.test.source.test_abc_loader.PyLoaderTests)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_abc_loader.py", line 138, in 
      test_module
          __loader__=mock)
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_abc_loader.py", line 128, in 
      eq_attrs
          "{} attribute: {} != {}".format(attr, found, val))
      ValueError: zero length field name in format

      ======================================================================
      ERROR: test_package
      (importlib.test.source.test_abc_loader.PyLoaderTests)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_abc_loader.py", line 151, in 
      test_package
          __loader__=mock)
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_abc_loader.py", line 128, in 
      eq_attrs
          "{} attribute: {} != {}".format(attr, found, val))
      ValueError: zero length field name in format

      ======================================================================
      ERROR: test_lacking_parent
      (importlib.test.source.test_abc_loader.PyPycLoaderTests)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_abc_loader.py", line 270, in 
      test_lacking_parent
          mock, name = super().test_lacking_parent()
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_abc_loader.py", line 162, in 
      test_lacking_parent
          __loader__=mock)
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_abc_loader.py", line 128, in 
      eq_attrs
          "{} attribute: {} != {}".format(attr, found, val))
      ValueError: zero length field name in format

      ======================================================================
      ERROR: test_module
      (importlib.test.source.test_abc_loader.PyPycLoaderTests)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_abc_loader.py", line 262, in 
      test_module
          mock, name = super().test_module()
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_abc_loader.py", line 138, in 
      test_module
          __loader__=mock)
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_abc_loader.py", line 128, in 
      eq_attrs
          "{} attribute: {} != {}".format(attr, found, val))
      ValueError: zero length field name in format

      ======================================================================
      ERROR: test_package
      (importlib.test.source.test_abc_loader.PyPycLoaderTests)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_abc_loader.py", line 266, in 
      test_package
          mock, name = super().test_package()
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_abc_loader.py", line 151, in 
      test_package
          __loader__=mock)
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_abc_loader.py", line 128, in 
      eq_attrs
          "{} attribute: {} != {}".format(attr, found, val))
      ValueError: zero length field name in format

      ======================================================================
      FAIL: test_case_insensitivity
      (importlib.test.extension.test_case_sensitivity.ExtensionModuleCaseSensi
      tivityTest)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/extension/test_case_sensitivity.py", line 29, 
      in test_case_insensitivity
          self.assert_(hasattr(loader, 'load_module'))
      AssertionError: False is not True

      ======================================================================
      FAIL: test_module_reuse
      (importlib.test.source.test_abc_loader.PyPycLoaderTests)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_abc_loader.py", line 275, in 
      test_module_reuse
          self.verify_bytecode(mock, name)
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/util.py", line 18, in wrapper
          to_return = fxn(*args, **kwargs)
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_abc_loader.py", line 253, in 
      verify_bytecode
          self.assert_(name in mock.module_bytecode)
      AssertionError: False is not True

      ======================================================================
      FAIL: test_insensitive
      (importlib.test.source.test_case_sensitivity.CaseSensitivityTest)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/cartman/Downloads/Python-
      3.1a2/Lib/importlib/test/source/test_case_sensitivity.py", line 49, in 
      test_insensitive
          self.assert_(hasattr(insensitive, 'load_module'))
      AssertionError: False is not True
    12. changed the title [-][3.1alpha1] test_importlib fails on Mac OSX 10.5.6[/-] [+][3.1alpha1,2] test_importlib fails on Mac OSX 10.5.6[/+] on Apr 5, 2009
    13. 4 remaining items

    14. brettcannon commented on May 7, 2009

      @brettcannon
      Member

      Bloody OS X and its default case-insensitivity.

      Ismail, please try the attached patch to double-check this solves the
      issue ASAP so this doesn't hold up Python 3.1 rc1.

    15. donmez commented on May 7, 2009

      donmezmannequin
      MannequinAuthor

      Tested with: ./python -m test.regrtest -v test_importlib

      3 failures:

      ======================================================================
      FAIL: test_case_insensitivity
      (importlib.test.extension.test_case_sensitivity.ExtensionModuleCaseSensi
      tivityTest)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/cartman/Python-
      3.1b1/Lib/importlib/test/extension/test_case_sensitivity.py", line 29, 
      in test_case_insensitivity
          self.assert_(hasattr(loader, 'load_module'))
      AssertionError: False is not True

      ======================================================================
      FAIL: test_lacking_parent
      (importlib.test.source.test_abc_loader.PyPycLoaderTests)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/cartman/Python-
      3.1b1/Lib/importlib/test/source/test_abc_loader.py", line 271, in 
      test_lacking_parent
          self.verify_bytecode(mock, name)
        File "/Users/cartman/Python-3.1b1/Lib/importlib/test/source/util.py", 
      line 18, in wrapper
          to_return = fxn(*args, **kwargs)
        File "/Users/cartman/Python-
      3.1b1/Lib/importlib/test/source/test_abc_loader.py", line 253, in 
      verify_bytecode
          self.assert_(name in mock.module_bytecode)
      AssertionError: False is not True

      ======================================================================
      FAIL: test_insensitive
      (importlib.test.source.test_case_sensitivity.CaseSensitivityTest)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/cartman/Python-
      3.1b1/Lib/importlib/test/source/test_case_sensitivity.py", line 49, in 
      test_insensitive
          self.assert_(hasattr(insensitive, 'load_module'))
      AssertionError: False is not True

      Ran 166 tests in 0.133s

      FAILED (failures=3)

    16. brettcannon commented on May 7, 2009

      @brettcannon
      Member

      Damn, that patch should have caused those case-sensitivity tests to be
      skipped. I will dig into this later today and hopefully have another
      patch to test some time tonight.

    17. changed the title [-][3.1alpha1,2,beta1] test_importlib fails on Mac OSX 10.5.6[/-] [+]test_importlib fails on Mac OSX 10.5.6 w/ case-sensitive file system[/+] on May 7, 2009
    18. brettcannon commented on May 8, 2009

      @brettcannon
      Member

      OK, Ismail, here is another patch. Revert the last one and try this.
      Looks like I was being stupid by forgetting to remove the 'darwin'
      platform check. But I also made the check simpler.

    19. donmez commented on May 8, 2009

      donmezmannequin
      MannequinAuthor

      Down to 1 failure:

      FAILED (failures=1)
      test test_importlib failed -- Traceback (most recent call last):
        File "/Users/cartman/Python-
      3.1b1/Lib/importlib/test/source/test_abc_loader.py", line 271, in 
      test_lacking_parent
          self.verify_bytecode(mock, name)
        File "/Users/cartman/Python-3.1b1/Lib/importlib/test/source/util.py", 
      line 18, in wrapper
          to_return = fxn(*args, **kwargs)
        File "/Users/cartman/Python-
      3.1b1/Lib/importlib/test/source/test_abc_loader.py", line 253, in 
      verify_bytecode
          self.assertIn(name, mock.module_bytecode)
      AssertionError: 'pkg.mod' not found in {}
    20. brettcannon commented on May 8, 2009

      @brettcannon
      Member

      Thanks for the quick reply, Ismail! I will look into the last failure
      this weekend, but off the top of my head I am not sure why that test
      would be failing since everything to do with that test should be a mock
      and thus not touching the file system.

    21. brettcannon commented on May 9, 2009

      @brettcannon
      Member

      OK, here is an attempt to fix this. My guess is it has something to do
      with sys.dont_write_bytecode, otherwise I cannot understand why you fail
      and not someone else since no other case-sensitive systems have reported
      this failure.

    22. donmez commented on May 10, 2009

      donmezmannequin
      MannequinAuthor

      1 Fail:

      test test_importlib crashed -- <class 'AttributeError'>: 'module' object 
      has no attribute 'writes_bytecode'
      Traceback (most recent call last):
        File "/Users/cartman/Python-3.1b1/Lib/test/regrtest.py", line 620, in 
      runtest_inner
          indirect_test()
        File "/Users/cartman/Python-3.1b1/Lib/test/test_importlib.py", line 6, 
      in test_main
          run_unittest(importlib.test.test_suite('importlib.test'))
        File "/Users/cartman/Python-3.1b1/Lib/importlib/test/__init__.py", 
      line 22, in test_suite
          package_tests = getattr(sys.modules[package_name], 'test_suite')()
        File "/Users/cartman/Python-
      3.1b1/Lib/importlib/test/source/__init__.py", line 8, in test_suite
          return importlib.test.test_suite('importlib.test.source', directory)
        File "/Users/cartman/Python-3.1b1/Lib/importlib/test/__init__.py", 
      line 16, in test_suite
          __import__(module_name, level=0)
        File "/Users/cartman/Python-
      3.1b1/Lib/importlib/test/source/test_file_loader.py", line 111, in 
      <module>
          class BadBytecodeTest(unittest.TestCase):
        File "/Users/cartman/Python-
      3.1b1/Lib/importlib/test/source/test_file_loader.py", line 130, in 
      BadBytecodeTest
          @source_util.writes_bytecode
      AttributeError: 'module' object has no attribute 'writes_bytecode'
      1 test failed:
          test_importlib
    23. brettcannon commented on May 10, 2009

      @brettcannon
      Member

      Bah, I screwed up and left a file out of skip_bytecode_writing.diff. If
      you apply test_file_loader along with that patch that should fix the error.

    24. donmez commented on May 10, 2009

      donmezmannequin
      MannequinAuthor

      Applied skip_bytecode.diff and test_file_loader.diff clean build
      results in:

      ======================================================================
      FAIL: test_case_insensitivity
      (importlib.test.extension.test_case_sensitivity.ExtensionModuleCaseSensi
      tivityTest)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/cartman/Python-
      3.1b1/Lib/importlib/test/extension/test_case_sensitivity.py", line 29, 
      in test_case_insensitivity
          self.assert_(hasattr(loader, 'load_module'))
      AssertionError: False is not True

      ======================================================================
      FAIL: test_insensitive
      (importlib.test.source.test_case_sensitivity.CaseSensitivityTest)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/cartman/Python-
      3.1b1/Lib/importlib/test/source/test_case_sensitivity.py", line 49, in 
      test_insensitive
          self.assert_(hasattr(insensitive, 'load_module'))
      AssertionError: False is not True

      Ran 166 tests in 0.124s

      FAILED (failures=2)
      test test_importlib failed -- errors occurred; run in verbose mode for
      details

    25. brettcannon commented on May 11, 2009

      @brettcannon
      Member

      OK, that means everything is fixed as case_sensitivity_tests.diff fixes
      those test errors.

      Committed in r72559.

    26. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    release-blockerstdlibStandard Library Python modules in the Lib/ directorytestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions