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 — Remove pathlib accessors · Issue #87178 · python/cpython

Remove pathlib accessors #87178

New issue
Copy link
New issue
Copy link
Closed
Closed
Remove pathlib accessors#87178
Copy link
Labels
3.11only security fixesonly security fixesperformancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory

Description

barneygale
mannequin
opened on Jan 23, 2021
Issue body actions
BPO 43012
Nosy @pitrou, @ericvsmith, @merwok, @encukou, @eryksun, @miss-islington, @barneygale
PRs
  • bpo-43012: remove pathlib._Accessor #25701
  • 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 2022-02-02.15:37:05.067>
    created_at = <Date 2021-01-23.18:15:55.455>
    labels = ['3.11', 'library', 'performance']
    title = 'Remove pathlib accessors'
    updated_at = <Date 2022-02-02.15:37:05.063>
    user = 'https://github.com/barneygale'

    bugs.python.org fields:

    activity = <Date 2022-02-02.15:37:05.063>
    actor = 'eric.araujo'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-02-02.15:37:05.067>
    closer = 'eric.araujo'
    components = ['Library (Lib)']
    creation = <Date 2021-01-23.18:15:55.455>
    creator = 'barneygale'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43012
    keywords = ['patch']
    message_count = 4.0
    messages = ['385556', '410732', '410733', '412353']
    nosy_count = 7.0
    nosy_names = ['pitrou', 'eric.smith', 'eric.araujo', 'petr.viktorin', 'eryksun', 'miss-islington', 'barneygale']
    pr_nums = ['25701']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue43012'
    versions = ['Python 3.11']

    Activity

    1. barneygale commented on Jan 23, 2021

      @barneygale
      barneygalemannequin
      on Jan 23, 2021
      MannequinAuthor
      More actions

      Per Pitrou:

      The original intent for the “accessor” thing was to have a variant that did all accesses under a filesystem tree in a race condition-free way using openat and friends. It turned out to be much too hairy to actually implement, so was entirely abandoned, but the accessor abstraction was left there.

      https://discuss.python.org/t/make-pathlib-extensible/3428/2

      Accessors are:

      • Lacking any internal purpose - '_NormalAccessor' is the only implementation
      • Lacking any firm conceptual difference to Path objects themselves (inc. subclasses)
      • Non-public, i.e. underscore prefixed - '_Accessor' and '_NormalAccessor'
      • Unofficially used to implement customized Path objects, but once once bpo-24132 lands there will be a supported route for that.

      When bpo-24132 lands, I think we're free to remove accessors and simplify some code

    2. barneygale
      added
      stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
      on Jan 23, 2021
    3. barneygale
      added
      3.11only security fixesonly security fixes
      performancePerformance or resource usagePerformance or resource usage
      on May 14, 2021
    4. merwok commented on Jan 16, 2022

      @merwok
      merwok
      on Jan 16, 2022
      Member
      More actions

      PR looks good, just needs a look by a pathlib expert.

    5. barneygale commented on Jan 16, 2022

      @barneygale
      barneygalemannequin
      on Jan 16, 2022
      MannequinAuthor
      More actions

      Thank you Éric!

    6. miss-islington commented on Feb 2, 2022

      @miss-islington
      miss-islington
      on Feb 2, 2022
      Contributor
      More actions

      New changeset 08f8301 by Barney Gale in branch 'main':
      bpo-43012: remove pathlib._Accessor (GH-25701)
      08f8301

    7. merwok
      closed this as completedon Feb 2, 2022
    8. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    9. ronf commented on May 28, 2022

      @ronf
      ronf
      on May 28, 2022
      Contributor
      More actions

      This change is actually causing a problem for me. I have a unit test case which mocks out os.path.expanduser() but not the pathlib version. This works in 3.10 and earlier due to the indirection of the accessors, but in 3.11 the code ends up failing, since now the pathlib version of expanduser() is also getting into my mock.

      I wonder if there might be other code out there which also might be depending on this behavior, without even realizing it.

    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.11only security fixesonly security fixesperformancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory

      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.