Author belopolsky
Recipients belopolsky
Date 2008-04-10.17:01:09
SpamBayes Score 0.00792537
Marked as misclassified No
Message-id <1207846870.93.0.178479630911.issue2609@psf.upfronthosting.co.za>
In-reply-to
Content
If @test file is not writable in the current directory,
test_support.TESTFN is changed to '/tmp/@test', but several tests fail
if TESTFN is an absolute path:

$ mkdir @test
$ make test
..
4 tests failed:
    test_import test_site test_urllib test_zipfile
..

For example,

$ ./python -E -tt ./Lib/test/regrtest.py -l test_urllib
test_urllib
test test_urllib failed -- Traceback (most recent call last):
  File "Lib/test/test_urllib.py", line 84, in test_geturl
    self.assertEqual(self.returned_obj.geturl(), self.pathname)
AssertionError: 'file:///tmp/@test' != '/tmp/@test'

Note that I discovered this problem after (probably killed) test_os left
 @test/ directory behind. It took me a while to realize what happened.

I think the simplest fix is to os.chdir to '/tmp' if @test is not
writable instead of changing TESTFN. Other solutions may include
deleting or renaming @test with a warning when it exists, using
tempnam() instead of @test and bailing out if cwd is not writeable etc.
History
Date User Action Args
2008-04-10 17:01:11belopolskysetspambayes_score: 0.00792537 -> 0.00792537
recipients: + belopolsky
2008-04-10 17:01:10belopolskysetspambayes_score: 0.00792537 -> 0.00792537
messageid: <1207846870.93.0.178479630911.issue2609@psf.upfronthosting.co.za>
2008-04-10 17:01:10belopolskylinkissue2609 messages
2008-04-10 17:01:09belopolskycreate