GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `pathlib.PurePath.match()` can incorrectly match empty path · Issue #106330 · python/cpython

pathlib.PurePath.match() can incorrectly match empty path #106330

New issue
Copy link
New issue
Copy link
Closed
Closed
pathlib.PurePath.match() can incorrectly match empty path#106330
Copy link
Labels
3.12only security fixesonly security fixes3.13only security fixesonly security fixestopic-pathlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@barneygale
barneygale
opened on Jul 2, 2023
Issue body actions
>>> from pathlib import PurePath
>>> PurePath().match('*')
True

This should be false, because a * segment always consumes exactly one path component, but empty paths have 0 components.

Linked PRs

  • GH-106330: Fix matching of empty path in pathlib.PurePath.match() #106331
  • [3.12] GH-106330: Fix matching of empty path in pathlib.PurePath.match() (GH-106331) #106372

Activity

  1. barneygale
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    3.12only security fixesonly security fixes
    topic-pathlib
    3.13only security fixesonly security fixes
    on Jul 2, 2023
  2. AlexWaygood
    changed the title [-]`pathlib.PurePath.match()` can incorrectly match empty patch[/-] [+]`pathlib.PurePath.match()` can incorrectly match empty path[/+] on Jul 2, 2023
  3. barneygale commented on Jul 2, 2023

    @barneygale
    barneygale
    on Jul 2, 2023
    ContributorAuthor
    More actions

    Caused by #101398. In Python 3.13 this can also affect glob() results.

  4. barneygale
    added 5 commits that reference this issue on Jul 2, 2023

    pythonGH-106330: Fix matching of empty path in `pathlib.PurePath.matc…

    4cc5778

    Merge branch 'main' into pythongh-106330-fix-match-empty-path

    6c1e28a

    GH-106330: Fix matching of empty path in `pathlib.PurePath.match()` (G…

    b4efdf8

    [3.12] pythonGH-106330: Fix matching of empty path in `pathlib.PurePa…

    e320740

    [3.12] GH-106330: Fix matching of empty path in `pathlib.PurePath.mat…

    d5ed72b
  5. barneygale commented on Jul 4, 2023

    @barneygale
    barneygale
    on Jul 4, 2023
    ContributorAuthor
    More actions

    Fixed!

  6. barneygale
    closed this as completedon Jul 4, 2023
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

    3.12only security fixesonly security fixes3.13only security fixesonly security fixestopic-pathlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.