[Python-Dev] weird bug in test_winreg

Guido van Rossum guido@python.org
Wed, 03 May 2000 20:52:39 -0400


I just noticed a weird traceback in test_winreg.  When I import
test.autotest on Windows, I get a "test failed" notice for
test_winreg.  When I run it by itself the test succeeds.  But when I
first import test.autotest and then import test.test_winreg (which
should rerun the latter, since test.regrtest unloads all test modules
after they have run), I get an AttributeError telling me that 'None'
object has no attribute 'get'.  This is in encodings.__init__.py in
the first call to _cache.get() in search_function.  Somehow this is
called by SetValueEx() in WriteTestData() in test/test_winreg.py.  But
inspection of the encodings module shows that _cache is {}, not None,
and the source shows no evidence of how this could have happened.

Any suggestions?

--Guido van Rossum (home page: http://www.python.org/~guido/)