classification
Title: Update urllib quoting to RFC 3986
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ncoghlan Nosy List: Matteo.Parrucci, ctheune, cvrebert, ezio.melotti, martin.panter, ncoghlan, orsenthil, piotr.dobrogost, rtnpro, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2012-10-19 10:56 by Matteo.Parrucci, last changed 2017-03-24 23:46 by ncoghlan. This issue is now closed.

Files
File name Uploaded Description Edit
0be3805cade1.diff ctheune, 2014-04-17 16:47 review
Pull Requests
URL Status Linked Edit
PR 173 merged python-dev, 2017-02-19 08:55
Repositories containing patches
https://bitbucket.org/ctheune/cpython#default-16285
Messages (6)
msg173319 - (view) Author: Matteo Parrucci (Matteo.Parrucci) Date: 2012-10-19 10:56
RFC 3986 (http://www.ietf.org/rfc/rfc3986.txt) says:

For consistency, percent-encoded octets in the ranges of ALPHA
(%41-%5A and %61-%7A), DIGIT (%30-%39), hyphen (%2D), period (%2E),
underscore (%5F), or tilde (%7E) should not be created by URI
producers and, when found in a URI, should be decoded to their
corresponding unreserved characters by URI normalizers.

From python documentation talking about urllib.quote()

Example: quote('/~connolly/') yields '/%7econnolly/'.

I think ~ should be added to the safe characters of quote function
msg173327 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-10-19 11:43
Yes, urllib based on RFC 2396, but RFC 3986 obsoletes RFC 2396.  Updating to RFC 3986 should be new feature.

For older versions can not change anything.  But you always can use "safe" argument with quote().
msg216698 - (view) Author: Christian Theune (ctheune) * Date: 2014-04-17 15:46
I'll update this.
msg288086 - (view) Author: Ratnadeep Debnath (rtnpro) * Date: 2017-02-18 19:37
I have started to work on this issue and get it merge ready.
msg288122 - (view) Author: Ratnadeep Debnath (rtnpro) * Date: 2017-02-19 08:58
Created a pull request for the attached patch along with update of related docstrings.
msg290403 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2017-03-24 23:46
New changeset 21024f06622c4c55b666adb130797a4ee205d005 by Nick Coghlan (Ratnadeep Debnath) in branch 'master':
bpo-16285: Update urllib quoting to RFC 3986 (#173)
https://github.com/python/cpython/commit/21024f06622c4c55b666adb130797a4ee205d005
History
Date User Action Args
2017-03-24 23:46:26ncoghlansetmessages: + msg290403
2017-02-25 09:00:58ncoghlansetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-02-25 08:23:56ncoghlansetassignee: ncoghlan
2017-02-25 08:23:45ncoghlansetstage: needs patch -> patch review
2017-02-19 08:58:02rtnprosetmessages: + msg288122
2017-02-19 08:55:11python-devsetpull_requests: + pull_request139
2017-02-19 06:43:00ncoghlansetversions: + Python 3.7, - Python 3.5
2017-02-18 19:37:00rtnprosetnosy: + rtnpro
messages: + msg288086
2017-01-20 16:46:30piotr.dobrogostsetnosy: + piotr.dobrogost
2014-04-18 01:50:23martin.pantersetnosy: + martin.panter
2014-04-17 16:47:08ctheunesetversions: + Python 3.5, - Python 3.4
2014-04-17 16:47:03ctheunesetfiles: + 0be3805cade1.diff
keywords: + patch
2014-04-17 16:46:47ctheunesethgrepos: - hgrepo242
2014-04-17 16:46:38ctheunesethgrepos: + hgrepo242
2014-04-17 16:04:16ctheunesethgrepos: + hgrepo241
2014-04-17 15:58:44ctheunesettitle: Update urllib to RFC 3986 -> Update urllib quoting to RFC 3986
2014-04-17 15:55:52pitrousetnosy: + ncoghlan
2014-04-17 15:46:43ctheunesetnosy: + ctheune
messages: + msg216698
2012-11-12 08:41:53serhiy.storchakasetstage: needs patch
2012-10-26 07:06:56cvrebertsetnosy: + cvrebert
2012-10-25 17:28:33ezio.melottisetnosy: + ezio.melotti
2012-10-19 11:43:08serhiy.storchakasettype: enhancement
title: Erroneously encoding tilde to %7e in quote -> Update urllib to RFC 3986
components: + Library (Lib)

nosy: + serhiy.storchaka, orsenthil
versions: + Python 3.4
messages: + msg173327
2012-10-19 10:56:08Matteo.Parruccicreate