This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Undeprecate and document urllib.parse.unwrap
Type: enhancement Stage: resolved
Components: Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: cheryl.sabella, eric.araujo, serhiy.storchaka, steven.daprano
Priority: normal Keywords: patch, patch, patch

Created on 2018-12-03 23:25 by steven.daprano, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11481 merged remi.lapeyre, 2019-01-09 17:13
PR 11481 merged remi.lapeyre, 2019-01-09 17:13
PR 11481 merged remi.lapeyre, 2019-01-09 17:13
Messages (4)
msg331003 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2018-12-03 23:25
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  #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. #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.
msg331945 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2018-12-17 03:47
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.
msg343624 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-05-27 13:43
New changeset 674ee1260025ff36f27e5d70ff6b66e3aab880bf by Cheryl Sabella (Rémi Lapeyre) in branch 'master':
bpo-35397: Remove deprecation and document urllib.parse.unwrap (GH-11481)
https://github.com/python/cpython/commit/674ee1260025ff36f27e5d70ff6b66e3aab880bf
msg343626 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-05-27 13:48
Thanks for the report and for the patch.  :-)
History
Date User Action Args
2022-04-11 14:59:08adminsetgithub: 79578
2019-05-27 13:48:59cheryl.sabellasetstatus: open -> closed
messages: + msg343626

keywords: patch, patch, patch
resolution: fixed
stage: patch review -> resolved
2019-05-27 13:43:48cheryl.sabellasetmessages: + msg343624
2019-01-09 17:14:07remi.lapeyresetkeywords: + patch
stage: patch review
pull_requests: + pull_request10998
2019-01-09 17:14:01remi.lapeyresetkeywords: + patch
stage: (no value)
pull_requests: + pull_request10997
2019-01-09 17:13:54remi.lapeyresetkeywords: + patch
stage: (no value)
pull_requests: + pull_request10996
2018-12-17 03:47:13eric.araujosetnosy: + eric.araujo
messages: + msg331945
2018-12-03 23:25:50steven.dapranocreate