summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urlparse.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2022-09-19 23:06:25 (GMT)
committerGitHub <noreply@github.com>2022-09-19 23:06:25 (GMT)
commite61ca2243163d829ab04d91d8e67940ea850aefa (patch)
tree4897f3571641d511770aad2e2d1fff505160792e /Lib/test/test_urlparse.py
parent04f4977f508583954ad7b9cb09076ee1e57461f8 (diff)
downloadcpython-e61ca2243163d829ab04d91d8e67940ea850aefa.zip
cpython-e61ca2243163d829ab04d91d8e67940ea850aefa.tar.gz
cpython-e61ca2243163d829ab04d91d8e67940ea850aefa.tar.bz2
gh-95865: Further reduce quote_from_bytes memory consumption (#96860)
on large input values. Based on Dennis Sweeney's chunking idea.
Diffstat (limited to 'Lib/test/test_urlparse.py')
-rw-r--r--Lib/test/test_urlparse.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
index 2f629c7..81d6018 100644
--- a/Lib/test/test_urlparse.py
+++ b/Lib/test/test_urlparse.py
@@ -985,6 +985,10 @@ class UrlParseTestCase(unittest.TestCase):
self.assertEqual(result, 'archaeological%20arcana')
result = urllib.parse.quote_from_bytes(b'')
self.assertEqual(result, '')
+ result = urllib.parse.quote_from_bytes(b'A'*10_000)
+ self.assertEqual(result, 'A'*10_000)
+ result = urllib.parse.quote_from_bytes(b'z\x01/ '*253_183)
+ self.assertEqual(result, 'z%01/%20'*253_183)
def test_unquote_to_bytes(self):
result = urllib.parse.unquote_to_bytes('abc%20def')