Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test glob with trailing slash fail on AIX 6.1 #62123

Closed
delhallt mannequin opened this issue May 7, 2013 · 9 comments
Closed

test glob with trailing slash fail on AIX 6.1 #62123

delhallt mannequin opened this issue May 7, 2013 · 9 comments
Assignees
Labels
easy stdlib Python modules in the Lib dir tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@delhallt
Copy link
Mannequin

delhallt mannequin commented May 7, 2013

BPO 17923
Nosy @ezio-melotti, @serhiy-storchaka, @koobs
Files
  • Python-2.7.4-glob.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 = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2014-08-12.15:41:55.885>
    created_at = <Date 2013-05-07.08:30:10.745>
    labels = ['easy', 'tests', 'type-bug', 'library']
    title = 'test glob with trailing slash fail on AIX 6.1'
    updated_at = <Date 2014-08-12.15:41:55.884>
    user = 'https://bugs.python.org/delhallt'

    bugs.python.org fields:

    activity = <Date 2014-08-12.15:41:55.884>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2014-08-12.15:41:55.885>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)', 'Tests']
    creation = <Date 2013-05-07.08:30:10.745>
    creator = 'delhallt'
    dependencies = []
    files = ['30162']
    hgrepos = []
    issue_num = 17923
    keywords = ['patch', 'easy']
    message_count = 9.0
    messages = ['188635', '224440', '224784', '224890', '224891', '224892', '225175', '225224', '225231']
    nosy_count = 7.0
    nosy_names = ['ezio.melotti', 'BreamoreBoy', 'python-dev', 'serhiy.storchaka', 'koobs', 'David.Edelsohn', 'delhallt']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue17923'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

    @delhallt
    Copy link
    Mannequin Author

    delhallt mannequin commented May 7, 2013

    test_glob's trailing_slash tests fails on AIX 6.1/Python 2.7.4:

    The code section for no_magic/slash case seems to be the issue.

    Attached patch resolves issue.

    FAIL: test_glob_directory_with_trailing_slash (test.test_glob.GlobTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/opt/freeware/lib/python2.7/test/test_glob.py", line 120, in test_glob_directory_with_trailing_slash
        self.assertEqual(res, [])
    AssertionError: Lists differ: ['@test_7602318_tmp_dir/ZZZ/'] != []

    First list contains 1 additional elements.
    First extra element 0:
    @test_7602318_tmp_dir/ZZZ/

    • ['@test_7602318_tmp_dir/ZZZ/']
      + []

    ======================================================================
    FAIL: test_glob_unicode_directory_with_trailing_slash (test.test_glob.GlobTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/opt/freeware/lib/python2.7/test/test_glob.py", line 137, in test_glob_unicode_directory_with_trailing_slash
        self.assertEqual(res, [])
    AssertionError: Lists differ: [u'@test_7602318_tmp_dir/ZZZ/'... != []

    First list contains 1 additional elements.
    First extra element 0:
    @test_7602318_tmp_dir/ZZZ/

    • [u'@test_7602318_tmp_dir/ZZZ/']
      + []

    @delhallt delhallt mannequin added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels May 7, 2013
    @ezio-melotti ezio-melotti added the stdlib Python modules in the Lib dir label May 10, 2013
    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Jul 31, 2014

    Couldn't part of the patch be simplified to:-

    if basename or os.path.isdir(dirname):
        yield pathname

    or have I misread it?

    @ezio-melotti
    Copy link
    Member

    Someone on AIX should verify this patch and confirm that it fixes the issue (and if Python 3 is affected or not).

    @ezio-melotti ezio-melotti changed the title test glob with trailing slash fail test glob with trailing slash fail on AIX 6.1 Aug 4, 2014
    @DavidEdelsohn
    Copy link
    Mannequin

    DavidEdelsohn mannequin commented Aug 5, 2014

    I tried the patch with Python-2.7.8 and it fixes the test_glob failure. Thanks!

    @DavidEdelsohn
    Copy link
    Mannequin

    DavidEdelsohn mannequin commented Aug 5, 2014

    The failure also occurs with Python 3 and the patch fixes test_glob for those releases.

    @koobs
    Copy link

    koobs commented Aug 5, 2014

    David, reproducible on 3.4 and default?

    We can use Version to reflect where changes need to be committed

    @DavidEdelsohn
    Copy link
    Mannequin

    DavidEdelsohn mannequin commented Aug 11, 2014

    3.4 and default also. The failure occurs on all branches and default.

    @serhiy-storchaka serhiy-storchaka self-assigned this Aug 12, 2014
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Aug 12, 2014

    New changeset e430973149ed by Serhiy Storchaka in branch '2.7':
    Issue bpo-17923: glob() patterns ending with a slash no longer match non-dirs on
    http://hg.python.org/cpython/rev/e430973149ed

    New changeset 5033589a752d by Serhiy Storchaka in branch '3.4':
    Issue bpo-17923: glob() patterns ending with a slash no longer match non-dirs on
    http://hg.python.org/cpython/rev/5033589a752d

    New changeset 6a71d3c79653 by Serhiy Storchaka in branch 'default':
    Issue bpo-17923: glob() patterns ending with a slash no longer match non-dirs on
    http://hg.python.org/cpython/rev/6a71d3c79653

    @serhiy-storchaka
    Copy link
    Member

    Thank you Delhallt.

    Mark, yes, you are right, but the code can be simplified even more, to do less syscalls.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    easy stdlib Python modules in the Lib dir tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants