Weird new test failures: import test.XYZ failing
I'm seeing three seemingly unrelated failures on Windows, seemingly unrelated to each other or to anything that's been checked in since the last time the tests passed. Anyone else? I blew away my intermediate files and rebuilt Python from scratch without visible change; debug-mode builds act the same too; only test_pyclbr.py was changed recently, but in a way that doesn't relate to the failure mode. Hmm -- but every one of them *is* trying to import something with a name of the form "test.XYZ". Ring a bell to anyone? C:\Code\python\PCbuild>python ../lib/test/test_pyclbr.py test_easy (__main__.PyclbrTest) ... ok test_others (__main__.PyclbrTest) ... ERROR ====================================================================== ERROR: test_others (__main__.PyclbrTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "../lib/test/test_pyclbr.py", line 153, in test_others module=sys.modules[__name__]) File "../lib/test/test_pyclbr.py", line 60, in checkModule dict = pyclbr.readmodule_ex(moduleName) File "C:\CODE\PYTHON\lib\pyclbr.py", line 171, in readmodule_ex child = readmodule_ex(submodule, parent['__path__'], 1) KeyError: __path__ ---------------------------------------------------------------------- Ran 2 tests in 2.090s FAILED (errors=1) Traceback (most recent call last): File "../lib/test/test_pyclbr.py", line 167, in ? test_main() File "../lib/test/test_pyclbr.py", line 163, in test_main run_unittest(PyclbrTest) File "../lib/test\test_support.py", line 190, in run_unittest run_suite(unittest.makeSuite(testclass), testclass) File "../lib/test\test_support.py", line 185, in run_suite raise TestFailed(err) test_support.TestFailed: Traceback (most recent call last): File "../lib/test/test_pyclbr.py", line 153, in test_others module=sys.modules[__name__]) File "../lib/test/test_pyclbr.py", line 60, in checkModule dict = pyclbr.readmodule_ex(moduleName) File "C:\CODE\PYTHON\lib\pyclbr.py", line 171, in readmodule_ex child = readmodule_ex(submodule, parent['__path__'], 1) KeyError: __path__ The full line there is cm('test.test_pyclbr', module=sys.modules[__name__]) C:\Code\python\PCbuild>python ../lib/test/test_descrtut.py Traceback (most recent call last): File "../lib/test/test_descrtut.py", line 501, in ? test_main(1) File "../lib/test/test_descrtut.py", line 496, in test_main import test_support, test.test_descrtut ImportError: No module named test_descrtut An obvious attempt to import test.test_descrtut. C:\Code\python\PCbuild>python ../lib/test/test_charmapcodec.py Traceback (most recent call last): File "../lib/test/test_charmapcodec.py", line 21, in ? check(unicode('abc', codecname), u'abc') LookupError: unknown encoding At line 21, codecname is codecname = 'test.testcodec'
[Tim'
I'm seeing three seemingly unrelated failures on Windows ... but every one of them *is* trying to import something with a name of the form "test.XYZ". Ring a bell to anyone?
Well, you've all failed me again <wink>. This turned out to be pilot error: I was running from my build directory, and it turned out I had a "test.py" file in there. So any sort of "import test.whatever" picked up that first. I have no idea where it came from, and staring at the contents didn't help because it also turned out it was empty (0 bytes). Removing test.py didn't help either. That's when I discovered test.pyc. The good news is that I remembered to delete test.pyo too before wasting another hour <0.9 wink>. some-days-suck-ly y'rs - tim
participants (1)
-
Tim Peters