Skip to content

Commit

Permalink
Add tests for failing PyUnicode_AsUTF8AndSize() with psize=NULL (pyth…
Browse files Browse the repository at this point in the history
…onGH-111100)

(cherry picked from commit b60f058)

Co-authored-by: Serhiy Storchaka <[email protected]>
  • Loading branch information
serhiy-storchaka authored and miss-islington committed Oct 20, 2023
1 parent b4c215e commit d2b43e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Lib/test/test_capi/test_unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,11 @@ def test_asutf8andsize(self):
self.assertRaises(UnicodeEncodeError, unicode_asutf8andsize, '\ud8ff', 0)
self.assertRaises(TypeError, unicode_asutf8andsize, b'abc', 0)
self.assertRaises(TypeError, unicode_asutf8andsize, [], 0)
self.assertRaises(UnicodeEncodeError, unicode_asutf8andsize_null, '\ud8ff', 0)
self.assertRaises(TypeError, unicode_asutf8andsize_null, b'abc', 0)
self.assertRaises(TypeError, unicode_asutf8andsize_null, [], 0)
# CRASHES unicode_asutf8andsize(NULL, 0)
# CRASHES unicode_asutf8andsize_null(NULL, 0)

@support.cpython_only
@unittest.skipIf(_testcapi is None, 'need _testcapi module')
Expand Down

0 comments on commit d2b43e3

Please sign in to comment.