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
test_importlib fails on Mac OSX 10.5.6 w/ case-sensitive file system #49692
Comments
Two failures in test_importlib: ====================================================================== 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 ====================================================================== 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 |
Is your version of OS X installed on a case-sensitive filesystem? These |
Yes its case sensitive. |
Ah, OK, that explains it then. I guess I need to come up with a test to Thanks for the quick response, Ismail. |
Fixed in r71042. |
If you could, Ismail, can you verify this either from svn or when the |
Sure thing, I am waiting for alpha2. Regards. |
Still fails with 3.1 alpha2: ====================================================================== 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 |
Something is wrong with your build, Ismail, because most of those But to speed this up, can you tell me what the file I attached to the |
[~]> python3.1 tester.py I'll do a rebuild just in case. Thanks. |
Fails in beta1. |
Bloody OS X and its default case-insensitivity. Ismail, please try the attached patch to double-check this solves the |
Tested with: ./python -m test.regrtest -v test_importlib 3 failures: ====================================================================== 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 Ran 166 tests in 0.133s FAILED (failures=3) |
Damn, that patch should have caused those case-sensitivity tests to be |
OK, Ismail, here is another patch. Revert the last one and try this. |
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 |
OK, here is an attempt to fix this. My guess is it has something to do |
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 |
Bah, I screwed up and left a file out of skip_bytecode_writing.diff. If |
Applied skip_bytecode.diff and test_file_loader.diff clean build ====================================================================== 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) |
OK, that means everything is fixed as case_sensitivity_tests.diff fixes Committed in r72559. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: