diff options
author | Ratnadeep Debnath <rtnpro@gmail.com> | 2017-02-25 09:00:28 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2017-02-25 09:00:28 (GMT) |
commit | 21024f06622c4c55b666adb130797a4ee205d005 (patch) | |
tree | 8b5f5381deb999d248430f3b2b8e351936e72fe8 /Lib/test/test_urllib.py | |
parent | 140792bd514ee4ba739fda899785bea3ce746f05 (diff) | |
download | cpython-21024f06622c4c55b666adb130797a4ee205d005.zip cpython-21024f06622c4c55b666adb130797a4ee205d005.tar.gz cpython-21024f06622c4c55b666adb130797a4ee205d005.tar.bz2 |
bpo-16285: Update urllib quoting to RFC 3986 (#173)
* bpo-16285: Update urllib quoting to RFC 3986
urllib.parse.quote is now based on RFC 3986, and hence
includes `'~'` in the set of characters that is not escaped
by default.
Patch by Christian Theune and Ratnadeep Debnath.
Diffstat (limited to 'Lib/test/test_urllib.py')
-rw-r--r-- | Lib/test/test_urllib.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index 5084486..bffbb0a 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -733,7 +733,7 @@ FF class QuotingTests(unittest.TestCase): r"""Tests for urllib.quote() and urllib.quote_plus() - According to RFC 2396 (Uniform Resource Identifiers), to escape a + According to RFC 3986 (Uniform Resource Identifiers), to escape a character you write it as '%' + <2 character US-ASCII hex value>. The Python code of ``'%' + hex(ord(<character>))[2:]`` escapes a character properly. Case does not matter on the hex letters. @@ -761,7 +761,7 @@ class QuotingTests(unittest.TestCase): do_not_quote = '' .join(["ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz", "0123456789", - "_.-"]) + "_.-~"]) result = urllib.parse.quote(do_not_quote) self.assertEqual(do_not_quote, result, "using quote(): %r != %r" % (do_not_quote, result)) |