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 — Use functools.lru_cache in urllib.parse instead of 1996 custom caching · Issue #88168 · python/cpython

Use functools.lru_cache in urllib.parse instead of 1996 custom caching #88168

New issue
Copy link
New issue
Copy link
Closed
Closed
Use functools.lru_cache in urllib.parse instead of 1996 custom caching#88168
Copy link
Assignees
gpshead
Labels
3.11only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

@gpshead
gpshead
opened on May 1, 2021
Issue body actions
BPO 44002
Nosy @gpshead
PRs
  • bpo-44002: Switch to lru_cache in urllib.parse. #25798
  • 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/gpshead'
    closed_at = <Date 2021-05-12.00:02:19.781>
    created_at = <Date 2021-05-01.18:17:15.725>
    labels = ['type-feature', 'library', '3.11']
    title = 'Use functools.lru_cache in urllib.parse instead of 1996 custom caching'
    updated_at = <Date 2021-05-12.00:02:19.781>
    user = 'https://github.com/gpshead'

    bugs.python.org fields:

    activity = <Date 2021-05-12.00:02:19.781>
    actor = 'gregory.p.smith'
    assignee = 'gregory.p.smith'
    closed = True
    closed_date = <Date 2021-05-12.00:02:19.781>
    closer = 'gregory.p.smith'
    components = ['Library (Lib)']
    creation = <Date 2021-05-01.18:17:15.725>
    creator = 'gregory.p.smith'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44002
    keywords = ['patch']
    message_count = 3.0
    messages = ['392614', '392619', '392620']
    nosy_count = 1.0
    nosy_names = ['gregory.p.smith']
    pr_nums = ['25798']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'commit review'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue44002'
    versions = ['Python 3.11']

    Activity

    1. gpshead commented on May 1, 2021

      @gpshead
      gpshead
      on May 1, 2021
      MemberAuthor
      More actions

      urllib.parse has custom caching code for both urlsplit() and quote(). From 1996.

      3fd32ec
      7449540

      with a truthful comment added by Nick in 2010 that we should just use functools.lru_cache.

      9fc443c#diff-b3712475a413ec972134c0260c8f1eb1deefb66184f740ef00c37b4487ef873e

      time to clean up this cruft and do that.

      I'm waiting for after the 3.10 cut and a still in progress urllib.parse security fix to land before rebasing my soon to be attached PR to avoid code conflicts.

    2. gpshead
      added
      3.11only security fixesonly security fixes
      on May 1, 2021
    3. gpshead
      self-assigned this
      on May 1, 2021
    4. gpshead
      added
      stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
      type-featureA feature request or enhancementA feature request or enhancement
      3.11only security fixesonly security fixes
      on May 1, 2021
    5. gpshead
      self-assigned this
      on May 1, 2021
    6. gpshead
      added
      stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
      type-featureA feature request or enhancementA feature request or enhancement
      on May 1, 2021
    7. rhettinger commented on May 1, 2021

      @rhettinger
      rhettinger
      on May 1, 2021
      Contributor
      More actions

      While you're cleaning up the module, take a look at the Quoter class. It overrides __init__ and __missing__, so Quoter is not using any of the defaultdict features at all. I'm thinking it could just inherit from dict.

    8. gpshead commented on May 1, 2021

      @gpshead
      gpshead
      on May 1, 2021
      MemberAuthor
      More actions

      Yeah, the Quoter class seems a little odd...

      Past notes of some the caching performance around the character quoting for quote() can be found in https://bugs.python.org/issue1285086 circa 2005-2010.

    9. gpshead
      closed this as completedon May 12, 2021
    10. gpshead
      closed this as completedon May 12, 2021
    11. ezio-melotti
      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

    • @gpshead
      gpshead

    Labels

    3.11only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

    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.