homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_shutil fails under AIX
Type: Stage:
Components: Tests Versions: Python 2.6
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: draghuram, pitrou, sable
Priority: normal Keywords: patch

Created on 2008年06月06日 14:51 by pitrou, last changed 2022年04月11日 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
3053.patch pitrou, 2008年06月06日 14:55
Messages (6)
msg67771 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008年06月06日 14:51
test_shutil fails with the following error under some AIX 5.3 machine:
======================================================================
FAIL: test_on_error (__main__.TestShutil)
----------------------------------------------------------------------
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_onerror
 self.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:
$ 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.
msg67772 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008年06月06日 14:55
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).
msg67774 - (view) Author: Raghuram Devarakonda (draghuram) (Python triager) Date: 2008年06月06日 15:11
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?
msg67776 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008年06月06日 15:21
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).
msg116026 - (view) Author: Sébastien Sablé (sable) Date: 2010年09月10日 16:10
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.
msg116032 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010年09月10日 17:25
Ok, closing. The original install was on a rather strange setup.
History
Date User Action Args
2022年04月11日 14:56:35adminsetgithub: 47303
2010年09月10日 17:25:04pitrousetstatus: open -> closed
resolution: works for me
messages: + msg116032
2010年09月10日 16:10:01sablesetnosy: + sable
messages: + msg116026
2010年06月09日 22:33:36terry.reedysetversions: - Python 2.5
2008年06月06日 15:21:02pitrousetmessages: + msg67776
2008年06月06日 15:11:44draghuramsetnosy: + draghuram
messages: + msg67774
2008年06月06日 14:55:25pitrousetfiles: + 3053.patch
keywords: + patch
messages: + msg67772
2008年06月06日 14:51:07pitroucreate

AltStyle によって変換されたページ (->オリジナル) /