classification
Title: Update urllib quoting to RFC 3986
Type: enhancement Stage: needs patch
Components: Library (Lib) Versions: Python 3.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Matteo.Parrucci, ctheune, cvrebert, ezio.melotti, ncoghlan, orsenthil, serhiy.storchaka, vadmium
Priority: normal Keywords: patch

Created on 2012-10-19 10:56 by Matteo.Parrucci, last changed 2014-04-18 01:50 by vadmium.

Files
File name Uploaded Description Edit
0be3805cade1.diff ctheune, 2014-04-17 16:47 review
Repositories containing patches
https://bitbucket.org/ctheune/cpython#default-16285
Messages (3)
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.
History
Date User Action Args
2014-04-18 01:50:23vadmiumsetnosy: + vadmium
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