You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "Lib/test/test_shutil.py", line 35, in test_on_error
shutil.rmtree(TESTFN, onerror=self.check_args_to_onerror)
File "/qakplus/qa_test/SandBoxes/Antoine/Python-2.5.2/Lib/shutil.py",
line 161, in rmtree
onerror(os.listdir, path, sys.exc_info())
File "Lib/test/test_shutil.py", line 49, in check_args_to_onerrorself.assertEqual(func, os.remove)
AssertionError: <built-in function listdir> != <built-in function remove>
The problem seems to be that the system is stricter with permissions
(please note I don't know AIX at all, and the filesystems are unknown
brands of network filesystems :-)), and @test in that test case is set
to chmod 0400:
Here is a working patch.
I've also added a try/finally block, because otherwise the following
tests in regrtest.py couldn't run properly (@test was unremovable
because of wrong permissions).
draghuram commented on Jun 6, 2008
draghurammannequin
Mannequin
More actions
Is there any particular reason to assert for failed function at all?
This test seems to be for 'onerror' function and the test would be valid
even without asserting whether the failed API is 'remove' or 'listdir'
etc. Isn't it?
Perhaps someone should ask the original author. But indeed I'm not sure
why it's testing such implementation details. The only requirement about
the first argument passed to the onerror callback is that it's one of
(os.listdir, os.remove, os.rmdir).
sable commented on Sep 10, 2010
sablemannequin
Mannequin
More actions
For info: I have no problem with test_shutil on AIX 6.1 with python 2.6.6 or python 3.2alpha2.
There may be no problem anymore.
Activity
pitrou commentedon Jun 6, 2008
test_shutil fails with the following error under some AIX 5.3 machine:
======================================================================
FAIL: test_on_error (main.TestShutil)
----------------------------------------------------------------------
The problem seems to be that the system is stricter with permissions
(please note I don't know AIX at all, and the filesystems are unknown
brands of network filesystems :-)), and @test in that test case is set
to chmod 0400:
$ chmod 400 @test $ ./python -c "import os; print os.listdir('@test')" Traceback (most recent call last): File "<string>", line 1, in <module> OSError: [Errno 13] Permission denied: '@test' $ chmod 100 @test $ ./python -c "import os; print os.listdir('@test')" Traceback (most recent call last): File "<string>", line 1, in <module> OSError: [Errno 13] Permission denied: '@test' $ chmod 500 @test $ ./python -c "import os; print os.listdir('@test')" ['a']The error was witnessed with Python 2.5.2 but the test case doesn't seem
to have changed in trunk so it should be the same there too.
pitrou commentedon Jun 6, 2008
Here is a working patch.
I've also added a try/finally block, because otherwise the following
tests in regrtest.py couldn't run properly (@test was unremovable
because of wrong permissions).
draghuram commentedon Jun 6, 2008
Is there any particular reason to assert for failed function at all?
This test seems to be for 'onerror' function and the test would be valid
even without asserting whether the failed API is 'remove' or 'listdir'
etc. Isn't it?
pitrou commentedon Jun 6, 2008
Apparently it dates back to this commit:
http://hg.pitrou.net/public/cpython/trunk/rev/56254b99fb78
Perhaps someone should ask the original author. But indeed I'm not sure
why it's testing such implementation details. The only requirement about
the first argument passed to the onerror callback is that it's one of
(os.listdir, os.remove, os.rmdir).
sable commentedon Sep 10, 2010
For info: I have no problem with test_shutil on AIX 6.1 with python 2.6.6 or python 3.2alpha2.
There may be no problem anymore.
pitrou commentedon Sep 10, 2010
Ok, closing. The original install was on a rather strange setup.