Skip to content

test_shutil fails under AIX #47303

Closed
Closed

Description

@pitrou
BPO 3053
Nosy @pitrou
Files
  • 3053.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2010-09-10.17:25:04.991>
    created_at = <Date 2008-06-06.14:51:07.116>
    labels = ['tests']
    title = 'test_shutil fails under AIX'
    updated_at = <Date 2010-09-10.17:25:04.989>
    user = 'https://github.com/pitrou'

    bugs.python.org fields:

    activity = <Date 2010-09-10.17:25:04.989>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-09-10.17:25:04.991>
    closer = 'pitrou'
    components = ['Tests']
    creation = <Date 2008-06-06.14:51:07.116>
    creator = 'pitrou'
    dependencies = []
    files = ['10535']
    hgrepos = []
    issue_num = 3053
    keywords = ['patch']
    message_count = 6.0
    messages = ['67771', '67772', '67774', '67776', '116026', '116032']
    nosy_count = 3.0
    nosy_names = ['pitrou', 'draghuram', 'sable']
    pr_nums = []
    priority = 'normal'
    resolution = 'works for me'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue3053'
    versions = ['Python 2.6']

    Activity

    1. pitrou commented on Jun 6, 2008

      @pitrou
      MemberAuthor

      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.

    2. pitrou commented on Jun 6, 2008

      @pitrou
      MemberAuthor

      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).

    3. draghuram commented on Jun 6, 2008

      draghurammannequin
      Mannequin

      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?

    4. pitrou commented on Jun 6, 2008

      @pitrou
      MemberAuthor

      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).

    5. sable commented on Sep 10, 2010

      sablemannequin
      Mannequin

      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.

    6. pitrou commented on Sep 10, 2010

      @pitrou
      MemberAuthor

      Ok, closing. The original install was on a rather strange setup.

    7. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      testsTests in the Lib/test dir

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions