summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unicode.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-01-12 07:22:29 (GMT)
committerGitHub <noreply@github.com>2019-01-12 07:22:29 (GMT)
commit44cc4822bb3799858201e61294c5863f93ec12e2 (patch)
treef7d25e8a7403e81d86893c8a2f7f5402297bd903 /Lib/test/test_unicode.py
parentd0d3e99120b19a4b800f0f381b2807c93aeecf0e (diff)
downloadcpython-44cc4822bb3799858201e61294c5863f93ec12e2.zip
cpython-44cc4822bb3799858201e61294c5863f93ec12e2.tar.gz
cpython-44cc4822bb3799858201e61294c5863f93ec12e2.tar.bz2
bpo-33817: Fix _PyBytes_Resize() for empty bytes object. (GH-11516)
Add also tests for PyUnicode_FromFormat() and PyBytes_FromFormat() with empty result.
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r--Lib/test/test_unicode.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index fb7bb2d..c277e70 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -2680,6 +2680,12 @@ class CAPITest(unittest.TestCase):
check_format('%.%s',
b'%.%s', b'abc')
+ # Issue #33817: empty strings
+ check_format('',
+ b'')
+ check_format('',
+ b'%s', b'')
+
# Test PyUnicode_AsWideChar()
@support.cpython_only
def test_aswidechar(self):