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

Undeprecate and document urllib.parse.unwrap #79578

Closed
stevendaprano opened this issue Dec 3, 2018 · 4 comments
Closed

Undeprecate and document urllib.parse.unwrap #79578

stevendaprano opened this issue Dec 3, 2018 · 4 comments
Labels
3.8 only security fixes type-feature A feature request or enhancement

Comments

@stevendaprano
Copy link
Member

BPO 35397
Nosy @merwok, @stevendaprano, @serhiy-storchaka, @csabella
PRs
  • bpo-35397: Remove deprecation and document urllib.parse.unwrap #11481
  • bpo-35397: Remove deprecation and document urllib.parse.unwrap #11481
  • bpo-35397: Remove deprecation and document urllib.parse.unwrap #11481
  • 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 2019-05-27.13:48:59.972>
    created_at = <Date 2018-12-03.23:25:50.480>
    labels = ['type-feature', '3.8']
    title = 'Undeprecate and document urllib.parse.unwrap'
    updated_at = <Date 2019-05-27.13:48:59.971>
    user = 'https://github.com/stevendaprano'

    bugs.python.org fields:

    activity = <Date 2019-05-27.13:48:59.971>
    actor = 'cheryl.sabella'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-05-27.13:48:59.972>
    closer = 'cheryl.sabella'
    components = []
    creation = <Date 2018-12-03.23:25:50.480>
    creator = 'steven.daprano'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35397
    keywords = ['patch', 'patch', 'patch']
    message_count = 4.0
    messages = ['331003', '331945', '343624', '343626']
    nosy_count = 4.0
    nosy_names = ['eric.araujo', 'steven.daprano', 'serhiy.storchaka', 'cheryl.sabella']
    pr_nums = ['11481', '11481', '11481']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue35397'
    versions = ['Python 3.8']

    @stevendaprano
    Copy link
    Member Author

    The urllib.parse module contains an undocumented function unwrap:

    unwrap('<URL:type://host/path>') --> 'type://host/path'
    

    This is useful. I've been re-inventing this function in many of my scripts, because I didn't know it existed (not documented!) and only stumbled across it by accident today, where I see it was deprecated in bpo-27485 but I can't see any reason for the deprecation.

    If not for the deprecation, I would certainly use this unwrap function in preference to rolling my own.

    It seems to me that this might have been a case of an over-enthusiastic change. bpo-27485 talks about deprecating the various split* functions, which are officially redundant (urlparse and urlsplit are preferred) but doesn't talk about unwrap, which is useful and (in my opinion) should have been documented rather than deprecated.

    @stevendaprano stevendaprano added 3.8 only security fixes type-feature A feature request or enhancement labels Dec 3, 2018
    @merwok
    Copy link
    Member

    merwok commented Dec 17, 2018

    I suspect the only reason was that unwrap was caught in the bag of «undocumented functions (that don‘t seem useful)».

    Personally I think I see more bare URLs than URLs in angle brackets these days, and `URL:` feels like an archaic marker :) But I don’t see any harm in un-deprecating and documenting the function now that you say you would find it useful.

    @csabella
    Copy link
    Contributor

    New changeset 674ee12 by Cheryl Sabella (Rémi Lapeyre) in branch 'master':
    bpo-35397: Remove deprecation and document urllib.parse.unwrap (GH-11481)
    674ee12

    @csabella
    Copy link
    Contributor

    Thanks for the report and for the patch. :-)

    @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.8 only security fixes type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants