You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_importlib fails on Mac OSX 10.5.6 w/ case-sensitive file system #49692
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.
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'
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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.
donmez commented on May 8, 2009
donmezmannequin
MannequinAuthor
More actions
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 {}
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.
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.
donmez commented on May 10, 2009
donmezmannequin
MannequinAuthor
More actions
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>
classBadBytecodeTest(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
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
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
Activity
donmez commentedon Mar 8, 2009
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: Nonebrettcannon commentedon Mar 8, 2009
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.
donmez commentedon Mar 8, 2009
Yes its case sensitive.
brettcannon commentedon Mar 8, 2009
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.
brettcannon commentedon Apr 2, 2009
Fixed in r71042.
brettcannon commentedon Apr 3, 2009
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?
donmez commentedon Apr 4, 2009
Sure thing, I am waiting for alpha2.
Regards.
donmez commentedon Apr 5, 2009
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[-][3.1alpha1] test_importlib fails on Mac OSX 10.5.6[/-][+][3.1alpha1,2] test_importlib fails on Mac OSX 10.5.6[/+]4 remaining items
brettcannon commentedon May 7, 2009
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.
donmez commentedon May 7, 2009
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 TrueRan 166 tests in 0.133s
FAILED (failures=3)
brettcannon commentedon May 7, 2009
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.
[-][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[/+]brettcannon commentedon May 8, 2009
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.
donmez commentedon May 8, 2009
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 {}brettcannon commentedon May 8, 2009
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.
brettcannon commentedon May 9, 2009
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.
donmez commentedon May 10, 2009
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_importlibbrettcannon commentedon May 10, 2009
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.
donmez commentedon May 10, 2009
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 TrueRan 166 tests in 0.124s
FAILED (failures=2)
test test_importlib failed -- errors occurred; run in verbose mode for
details
brettcannon commentedon May 11, 2009
OK, that means everything is fixed as case_sensitivity_tests.diff fixes
those test errors.
Committed in r72559.