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
  • Loading branch information
serhiy-storchaka authored Oct 20, 2023
1 parent c42c68a commit b60f058
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 @@ -906,7 +906,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 b60f058

Please sign in to comment.