Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove len assumptions from %p
  • Loading branch information
sobolevn committed Sep 8, 2022
commit 9faf155ce00f5e599e12894802fe5a62d1f5cbb8
4 changes: 1 addition & 3 deletions Lib/test/test_unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -2814,12 +2814,10 @@ def check_format(expected, format, *args):
p_format1 = PyUnicode_FromFormat(b'%p', 'abc')
self.assertIsInstance(p_format1, str)
self.assertTrue(p_format1.startswith('0x'))
self.assertEqual(len(p_format1), 11)

p_format2 = PyUnicode_FromFormat(b'repr=%p', b'xyz')
p_format2 = PyUnicode_FromFormat(b'repr=%p', '123456', b'xyz')
self.assertIsInstance(p_format2, str)
self.assertTrue(p_format2.startswith('repr=0x'))
self.assertEqual(len(p_format2), 11 + 5)

# Test string decode from parameter of %s using utf-8.
# b'\xe4\xba\xba\xe6\xb0\x91' is utf-8 encoded byte sequence of
Expand Down