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

PurePath.match indicates case-sensitive nature and presents a case-insensitive example #83466

Closed
tirkarthi opened this issue Jan 10, 2020 · 4 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@tirkarthi
Copy link
Member

BPO 39285
Nosy @pitrou, @serhiy-storchaka, @miss-islington, @tirkarthi, @timlo
PRs
  • bpo-39285: Clarify example for PurePath.match #19458
  • [3.8] bpo-39285: Clarify example for PurePath.match (GH-19458) #19597
  • [3.7] bpo-39285: Clarify example for PurePath.match (GH-19458) #19598
  • 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 2020-04-19.10:04:10.764>
    created_at = <Date 2020-01-10.10:06:55.981>
    labels = ['3.8', 'type-bug', '3.7', '3.9', 'docs']
    title = 'PurePath.match indicates case-sensitive nature and presents a case-insensitive example'
    updated_at = <Date 2020-04-19.10:04:10.763>
    user = 'https://github.com/tirkarthi'

    bugs.python.org fields:

    activity = <Date 2020-04-19.10:04:10.763>
    actor = 'pitrou'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2020-04-19.10:04:10.764>
    closer = 'pitrou'
    components = ['Documentation']
    creation = <Date 2020-01-10.10:06:55.981>
    creator = 'xtreak'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39285
    keywords = ['patch']
    message_count = 4.0
    messages = ['359717', '366772', '366774', '366775']
    nosy_count = 6.0
    nosy_names = ['pitrou', 'docs@python', 'serhiy.storchaka', 'miss-islington', 'xtreak', 'timlo']
    pr_nums = ['19458', '19597', '19598']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue39285'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @tirkarthi
    Copy link
    Member Author

    https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.match

    Under PurePath.match there is a statement that case-sensitivity is followed but presents an example in Windows where case insensitive match returns True. This is confusing since match internally uses fnmatch.fnmatchcase that doesn't normalize case but in Windows files are case insensitive. Either the doc could be clarified that it's platform dependent or present a PosixPath example or present two examples with one for Linux and one for Windows that it's platform dependent.

    As with other methods, case-sensitivity is observed:

    >>> PureWindowsPath('b.py').match('*.PY')
    True

    @tirkarthi tirkarthi added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes labels Jan 10, 2020
    @tirkarthi tirkarthi added docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes labels Jan 10, 2020
    @tirkarthi tirkarthi added docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error labels Jan 10, 2020
    @miss-islington
    Copy link
    Contributor

    New changeset c12375a by Tim Lo in branch 'master':
    bpo-39285: Clarify example for PurePath.match (GH-19458)
    c12375a

    @miss-islington
    Copy link
    Contributor

    New changeset 8c07343 by Miss Islington (bot) in branch '3.8':
    bpo-39285: Clarify example for PurePath.match (GH-19458)
    8c07343

    @miss-islington
    Copy link
    Contributor

    New changeset 143147d by Miss Islington (bot) in branch '3.7':
    bpo-39285: Clarify example for PurePath.match (GH-19458)
    143147d

    @pitrou pitrou closed this as completed Apr 19, 2020
    @pitrou pitrou closed this as completed Apr 19, 2020
    @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
    3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants