[Python-Dev] 2.3.1 is (almost) a go (original) (raw)

Jeff Epler jepler at unpythonic.net
Wed Sep 24 08:10:51 EDT 2003


On Wed, Sep 24, 2003 at 07:53:26AM -0400, Barry Warsaw wrote:

I pulled down rc2 and ran the tests randomly on RH9, with "-u all -r". I see that testmimetypes failed unexpectedly:

test testmimetypes failed -- Traceback (most recent call last): File "/tmp/Python-2.3.1/Lib/test/testmimetypes.py", line 52, in testguessalltypes eq(all, ['.bat', '.c', '.h', '.ksh', '.pl', '.txt']) File "/tmp/Python-2.3.1/Lib/unittest.py", line 302, in failUnlessEqual _raise self.failureException, _ AssertionError: ['.asc', '.bat', '.c', '.h', '.ksh', '.pl', '.txt'] != ['.bat', '.c', '.h', '.ksh', '.pl', '.txt']

This order fails: [jepler at parrot Lib]$ ../python test/regrtest.py test_urllib2 test_mimetypes

This order doesn't: [jepler at parrot Lib]$ ../python test/regrtest.py test_mimetypes test_urllib2

urllib2 calls mimetypes.guess_type without zeroing out mimetypes.knownfiles. I think this is the cause. Adding this patch makes both orders pass.

Perhaps a better way to fix it would be to test for a superset in test_mimetypes. assert set(all) >= set('.bat', ...)

--- test_urllib2.py.orig 2003-09-24 07:08:28.000000000 -0500 +++ test_urllib2.py 2003-09-24 07:07:31.000000000 -0500 @@ -11,6 +11,10 @@ else: verify(0)

+import mimetypes +mimetypes.knownfiles = [] +mimetypes.inited = False +

XXX Name hacking to get this to work on Windows.

fname = os.path.abspath(urllib2.file).replace('\', '/') if fname[1:2] == ":":



More information about the Python-Dev mailing list